Log in

View Full Version : CSS Placement of Google Adsense on Right Hand Side?



mgordon
10-31-2007, 05:30 PM
Hello All,

I'm not too savvy with CSS, so please pardon if this seems uber easy.

I have started to use Google AdSense on my web pages (Please see http://www.pwcparks.org/CalendarOfEvents/tabid/176/Default.aspx), In Firefox, it shows the main content on the left hand side and the Ads on the right hand side in a columnar format, however, there is no word wrapping going on. In Internet Explorer, the AdSense shows at the top right and then below that my content starts.

Here is what I have in my HTML in a single TD Cell:



[!--
google_ad_client = "myAdSenseID";
google_alternate_ad_url = "(Alternate Adsense URL)";
google_ad_width = 120;
google_ad_height = 240;
google_ad_format = "120x240_as";
google_ad_type = "text";
google_ad_channel = "";
google_color_border = "FFFFFF";
google_color_bg = "FFFFFF";
google_color_link = "0000FF";
google_color_text = "000000";
google_color_url = "008000";
//--]






[!-- Show my main content --]


[!-- End my main content --]




This is what I have in my CSS:

.google120rightbanner [
width: 122px;
margin: 15px 10px 5px 10px;
float: right; /*allows main content to wrap around the google ad */
/*note: after this we need to use the clear class to clear the float at end of container */
]

.clear [
clear: both;
]


NOTE: I have changed the brackets so I can display this message on the forums.

Does anyone have any idea what I am doing wrong here in getting the display I want using this CSS? Again, I'm not very savvy about this, so a good explanation would be helpful.

Thank you all very much!

Mark Gordon

TimFA
10-31-2007, 07:05 PM
Use the [ code ] [/ code ] tags, much easier :D. Ok, have you tried



position: absolute;
right: 0px;


I've not tested but, that might fix it (using it instead of what you have). I'm not sure if I understand though.

mgordon
10-31-2007, 07:28 PM
Interesting. This is what it looks like now in IE. (http://www.pwcparks.org/Recreation/BenLomondCommunityCenter/tabid/73/Default.aspx)

What I'm looking for is for the Ads to appear within my templated border, right next to my main content.

TimFA
11-01-2007, 03:27 AM
Its in there, I didn't view it earlier, so I have no clue what it looked like.

ClaireP
11-12-2007, 05:26 AM
I have never used:
<div class="clear"></div>

I use:
<br class="clear" />

That will clear anything from floating next to the floated div.

ClaireP