• dyomainer

    (@dyomainer)


    Hi everyone,

    I want to introduce a margin of 50px around all adsense ad units on yvd.com.

    I am still learning css atm. I would like to insert a margin of 50px below and above each ad unit. Then add a caption “ädvertisement” above each ad unit on game, home, and category pages.

    I have these classes and selectors in the css stylesheet (see code)

    .adsensead{
    text-align:center;
    margin: 100px 0px 100px 0;
    padding: 100px;
    frnt_advert
    .frnt_advert{ float: right; height:319px;}
    google_search
    #google_search{ margin-bottom: 5px;}

    Can you suggest how the code for a div inside the stylesheet would look like and where I would insert it on the main pages?

    Any ideas? Many thanks

Viewing 6 replies - 1 through 6 (of 6 total)
  • Michael

    (@alchymyth)

    I would like to insert a margin of 50px below and above each ad unit.

    edit this line:

    margin: 100px 0px 100px 0;

    http://www.w3schools.com/css/css_margin.asp

    Can you suggest how the code for a div inside the stylesheet would look like and where I would insert it on the main pages?

    you can’t insert a div or any html code into a stylesheet.

    the adding of a caption will depend on how the ads are inserted right now.

    a link to your site might help to illustrate your problem.

    Thread Starter dyomainer

    (@dyomainer)

    thanks for your reply,follow this link yvd.com to see my site. let me know

    Michael

    (@alchymyth)

    where you have this now: (caution – i obscured your personal numbers)

    /*
    commented google adsense<div
    class="adsensead"> <script type="text/javascript">google_ad_client = "pub-12345678899";
    /* 728x90, created 4/22/10 */
    google_ad_slot = "0987654433";
    google_ad_width = 728;
    google_ad_height = 90;</script> <script type="text/javascript"
    src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script> </div> commented google adsense
    */

    try:

    <div
    class="adsensead"><span>some caption title</span><script type="text/javascript">google_ad_client = "pub-12345678899";
    /* 728x90, created 4/22/10 */
    google_ad_slot = "0987654433";
    google_ad_width = 728;
    google_ad_height = 90;</script> <script type="text/javascript"
    src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script> </div>

    and edit header.php to make sure that there is no script before the ‘doctype’ declaration.

    Thread Starter dyomainer

    (@dyomainer)

    many thanks again, done but how can i make the static caption position above the ad unit? or rather i would like to create a margin of 50px around the ad in addition to this caption. cheers

    Michael

    (@alchymyth)

    untested:

    .adsensead span { display:block; width: 100%; }
    .adsensead { margin: 50px 0px; }

    for more suggestion, the adsense unit needs to be activated and visible in your link – this makes it easier to check and suggest changes to the stylesheet.

    Thread Starter dyomainer

    (@dyomainer)

    i’ve activated the adsense units. let me know if there is anything else you’d like to add. thanks

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘ad unit margins and captions’ is closed to new replies.