• Hello
    Can someone please help me center the script below. I had a problem earlier with adding ads/banner right below the head of my page. I figured that out, but now i’m having a problem getting it to center the right way (in the middle of the page). Below is the code i am using and the website is 412hiphop.com is the website where you can see the problem i’m having. Do I have to do something in the stylesheet? I tired and couldn’t find anything in there to help. Thanks for any help in advance.

    </div>
    <div id=”ad_hf”>
    <script type=”text/javascript”><!–
    google_ad_client = “pub-3621094593310486”;
    google_alternate_ad_url = “http://themey.com/altads/adsense/728×90.html&#8221;;
    google_ad_width = 728;
    google_ad_height = 90;
    google_ad_format = “728x90_as”;
    google_ad_type = “text_image”;
    google_ad_channel = “”;
    google_color_border = “FFFF00”;
    google_color_bg = “FFFF00”;
    google_color_link = “000000”;
    google_color_text = “000000”;
    google_color_url = “000000”;
    //–></script>
    <script type=”text/javascript”
    src=”http://pagead2.googlesyndication.com/pagead/show_ads.js”&gt;
    </script>
    </div>
    </div>

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter miniru77

    (@miniru77)

    Help please!!!
    I tried calling the ad at different times and it just messes up the page. Below is what my header looks like. Am I calling it to early?

    [Moderated: Too much code. Please consider placing the code in a text file on your site with a link here -or- use a pastebin service such as http://wordpress.pastebin.ca. Thanks!]

    thanks for the help

    Hi miniru,

    I downloaded the theme on my localhost and tried. This is what I found:

    Add

    <div id=”googleads”>//Your adsense code here</div>

    immediately above <div id="page"> in the theme’s header.php file.

    Then add this in your theme’s stylesheet:

    #googleads {
    text-align: center;
    padding: 0px 0 0px 0px; margin: 0 auto;
    color:#000000;
     }

    1-if you’re asking to change the look of the google ad, i don’t know how to other than editing it directly in your AS control panel. FYI, you aren’t allowed to edit the actual style of google ads. it’s a violation of their tos/they’ll close your account.

    2-if you’re just asking for a way to just center the ad *unit* on your site, the only advice i can give you is: use a table. <table><tr><td align=center>AS Code</td></tr></table>

    One little ‘ugly’ table won’t hurt your presumably css-driven site. 🙂

    If you insist on using css and your header/banner is a fixed with, like 1000px, just alter the “margin-left” until the ad is centered.

    Thread Starter miniru77

    (@miniru77)

    thanks!!!
    The first suggestion worked fine. I love learning this stuff.

    Godbless

    Also, you might want to look up how to center div and other page elements properly

    There’s a great explanation here.

    Mostly, it is putting your margin to auto and text-align your body properties to center. From that point you can text-align your div items to be left or right, but the elements themselves will be centered.

    A.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Help will banner/header issue’ is closed to new replies.