Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

ElectricMan5

macrumors regular
Original poster
Jul 22, 2008
204
0
Hi, I'm trying to get a vertical ad on Google Adsense to show up on the far left portion of my site, but in the CSS there are borders, and I don't know how to get JUST the ad to go there.

A screenshot of the template is attached...


Thanks!
 

Attachments

  • Screen shot 2009-09-18 at 5.57.37 PM.png
    Screen shot 2009-09-18 at 5.57.37 PM.png
    120.8 KB · Views: 130
Just put the code for the ad in that section. I am guessing that you probably have the body and then a div for your content so just put it in the body and position it to be in the left margin.
 
Just put the code for the ad in that section. I am guessing that you probably have the body and then a div for your content so just put it in the body and position it to be in the left margin.


Thanks I'll try that.

EDIT: YES!!! It worked! Thanks a lot man!
 
Hmm... I seem to have another problem now. I used this code as the first thing in the <body> tags, so it wasn't aligned with the rest of the content in the DIV tag for the content:

Code:
<DIV style="position: absolute; top: 190px; left: 5px; width: 150px; height: 200px"><script type="text/javascript"><!--
google_ad_client = "pub-2903055079924337";
/* Vertical Guitar Pilot ad */
google_ad_slot = "7936521350";
google_ad_width = 120;
google_ad_height = 600;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></DIV>

The only problem is, since the position is absolute, the ads stay in the same place, even if the page is resized, so in a different sized browser, where text is a bit larger, the ads are overlapping the text.

An screenshot is attached...

Can anyone solve this?

Thanks!
 

Attachments

  • Screen shot 2009-09-28 at 6.31.11 PM.png
    Screen shot 2009-09-28 at 6.31.11 PM.png
    97.7 KB · Views: 106
Yeah you won't be able to use absolute positing for the ad divs. I will be honest though, I don't know much about positioning for things like this. Perhaps someone else will read the thread and comment.

The good thing is that the ads are where you want them, now comes the part where you have to keep playing with layout and positioning to figure out how to work the resizing.
 
You could just use a fixed width for the entire page so that the content does not resize, it just adds scroll bars to the window when it is sized too small.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.