<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Google adsense scrolling fix</title>
	<atom:link href="http://nickwilsdon.com/google-adsense-scrolling-fix/feed/" rel="self" type="application/rss+xml" />
	<link>http://nickwilsdon.com/google-adsense-scrolling-fix/</link>
	<description></description>
	<lastBuildDate>Sun, 04 Apr 2010 16:08:00 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Online and Offline Promotion</title>
		<link>http://nickwilsdon.com/google-adsense-scrolling-fix/comment-page-1/#comment-8728</link>
		<dc:creator>Online and Offline Promotion</dc:creator>
		<pubDate>Sun, 19 Aug 2007 09:09:28 +0000</pubDate>
		<guid isPermaLink="false">http://www.e3internet.com/greenhouse/nick/03/05/2005/google-adsense-scrolling-fix/#comment-8728</guid>
		<description>&lt;strong&gt;Online and Offline Promotion...&lt;/strong&gt;

I couldn&#039;t understand some parts of this article, but it sounds interesting...</description>
		<content:encoded><![CDATA[<p><strong>Online and Offline Promotion&#8230;</strong></p>
<p>I couldn&#8217;t understand some parts of this article, but it sounds interesting&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Robyn</title>
		<link>http://nickwilsdon.com/google-adsense-scrolling-fix/comment-page-1/#comment-44</link>
		<dc:creator>Robyn</dc:creator>
		<pubDate>Fri, 14 Oct 2005 08:02:09 +0000</pubDate>
		<guid isPermaLink="false">http://www.e3internet.com/greenhouse/nick/03/05/2005/google-adsense-scrolling-fix/#comment-44</guid>
		<description>Had to finish this post so others searching here would know how it ended.  Nick emailed me and had me try the +5 height one more time and though it still jumps for me, it doesn&#039;t for him.  I need to change my text size on my computer to fix it now.  

Thanks a whole lot!</description>
		<content:encoded><![CDATA[<p>Had to finish this post so others searching here would know how it ended.  Nick emailed me and had me try the +5 height one more time and though it still jumps for me, it doesn&#8217;t for him.  I need to change my text size on my computer to fix it now.  </p>
<p>Thanks a whole lot!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nick</title>
		<link>http://nickwilsdon.com/google-adsense-scrolling-fix/comment-page-1/#comment-42</link>
		<dc:creator>Nick</dc:creator>
		<pubDate>Fri, 14 Oct 2005 07:56:59 +0000</pubDate>
		<guid isPermaLink="false">http://www.e3internet.com/greenhouse/nick/03/05/2005/google-adsense-scrolling-fix/#comment-42</guid>
		<description>Thanks for posting that Cody and I&#039;m sorry to hear your site is down, you had some great stuff there. Send me an email and I&#039;ll try to help you out on that. Maybe some e3internet sponsorship? ;)</description>
		<content:encoded><![CDATA[<p>Thanks for posting that Cody and I&#8217;m sorry to hear your site is down, you had some great stuff there. Send me an email and I&#8217;ll try to help you out on that. Maybe some e3internet sponsorship? ;)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Cody</title>
		<link>http://nickwilsdon.com/google-adsense-scrolling-fix/comment-page-1/#comment-41</link>
		<dc:creator>Cody</dc:creator>
		<pubDate>Fri, 14 Oct 2005 07:48:44 +0000</pubDate>
		<guid isPermaLink="false">http://www.e3internet.com/greenhouse/nick/03/05/2005/google-adsense-scrolling-fix/#comment-41</guid>
		<description>Ah, sorry the comments are stripping the HTML, which only makes sense. Told you I was tired :)

For the 468x60 ad, the google code is wrapped in a div with the class &quot;adsense468x60&quot;. Before the closing of this div, but after the Google code, is an empty div with the class &quot;adsense468hack&quot;.

For the 728x90 ad, the google code is wrapped in a div with the class &quot;adsense728x90&quot;. Before the closing of this div, but after the Google code, is an empty div with the class &quot;adsense728x90hack&quot;.

For the 468x15 ad, the google code is wrapped in a div with the class &quot;adsense468x15&quot;. No further DIV is necessary like the other ones.</description>
		<content:encoded><![CDATA[<p>Ah, sorry the comments are stripping the HTML, which only makes sense. Told you I was tired :)</p>
<p>For the 468&#215;60 ad, the google code is wrapped in a div with the class &#8220;adsense468&#215;60&#8243;. Before the closing of this div, but after the Google code, is an empty div with the class &#8220;adsense468hack&#8221;.</p>
<p>For the 728&#215;90 ad, the google code is wrapped in a div with the class &#8220;adsense728&#215;90&#8243;. Before the closing of this div, but after the Google code, is an empty div with the class &#8220;adsense728&#215;90hack&#8221;.</p>
<p>For the 468&#215;15 ad, the google code is wrapped in a div with the class &#8220;adsense468&#215;15&#8243;. No further DIV is necessary like the other ones.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Cody</title>
		<link>http://nickwilsdon.com/google-adsense-scrolling-fix/comment-page-1/#comment-40</link>
		<dc:creator>Cody</dc:creator>
		<pubDate>Fri, 14 Oct 2005 07:45:04 +0000</pubDate>
		<guid isPermaLink="false">http://www.e3internet.com/greenhouse/nick/03/05/2005/google-adsense-scrolling-fix/#comment-40</guid>
		<description>Well, either I pasted in the text wrong or the comment was too long at god wrangled. Here are the code snippets again.

468x60 html:






468x60 css:

.adsense468x60hack {
    height: 6px; /* dimension of the area you need to cover */
    width: 468px; /* dimension of the area you need to cover */
    background-color: #124F7D; /* color/image you are using to cover the white */
    position:relative;
    top:-10px; /* move the cover into place, change if you change the height */
}

.adsense468x60 {
    width: 468px; /* width of 468x60 ad */
    height:65px; /* height of 468x60 ad + extra white space */
    margin: 0 auto -6px auto; /* negative bottom margin is height of extra white space to prevent extra space around ad */
}

.adsense468x60 iframe {
    height: 65px;  /* height of 468x60 ad + extra white space */
    width: 468px; /* width of 468x60 ad */
}

/* turn off the covering div for IE */
* html .adsense468x60hack {
    height: 0px;
    width: 0px;
    background-color: transparent;
    top:0px;
}

/* bring ad back to regular size for IE, remove extra space that is for some reason introduced */
* html .adsense468x60 {
    height:60px;
    margin: 0 auto -20px auto;
}

/* bring ad back to regular size for IE */
* html .adsense468x60 iframe {
    height: 60px;
}

728x90 html:






728x90 css:

.adsense728x90hack {
    height: 7px; /* dimension of the area you need to cover */
    width: 728px; /* dimension of the area you need to cover */
    background-color: #124F7D; /* color/image you are using to cover the white */
    position:relative;
    top:-11px; /* move the cover into place, change if you change the height */
}

.adsense728x90 {
    width: 728px; /* width of 728x90 ad */
    height:96px; /* height of 728x90 ad + extra white space */
    margin: 0 auto -7px auto; /* negative bottom margin is height of extra white space to prevent extra space around ad */
}

.adsense728x90 iframe {
    height: 96px;  /* height of 728x90 ad + extra white space */
    width: 728px; /* width of 728x90 ad */
}

/* turn off the covering div for IE */
* html .adsense728x90hack {
    height: 0px;
    width: 0px;
    background-color: transparent;
    top:0px;
}

/* bring ad back to regular size for IE, remove extra space that is for some reason introduced */
* html .adsense728x90 {
    height:90px;
    margin: 0 auto -20px auto;
}

/* bring ad back to regular size for IE */
* html .adsense728x90 iframe {
    height: 90px;
}

468x15 html:





468x15 css:

.adsense468x15 {
    width: 468px; /* width of 468x15 ad */
    height:19px; /* height of 468x15 ad + extra white space */
    margin: 0 auto 0 auto; /* negative bottom margin is height of extra white space to prevent extra space around ad */

}

.adsense468x15 iframe {
    height: 19px;  /* height of 468x15 ad + extra white space */
    width: 468px; /* width of 468x15 ad */
}</description>
		<content:encoded><![CDATA[<p>Well, either I pasted in the text wrong or the comment was too long at god wrangled. Here are the code snippets again.</p>
<p>468&#215;60 html:</p>
<p>468&#215;60 css:</p>
<p>.adsense468&#215;60hack {<br />
    height: 6px; /* dimension of the area you need to cover */<br />
    width: 468px; /* dimension of the area you need to cover */<br />
    background-color: #124F7D; /* color/image you are using to cover the white */<br />
    position:relative;<br />
    top:-10px; /* move the cover into place, change if you change the height */<br />
}</p>
<p>.adsense468&#215;60 {<br />
    width: 468px; /* width of 468&#215;60 ad */<br />
    height:65px; /* height of 468&#215;60 ad + extra white space */<br />
    margin: 0 auto -6px auto; /* negative bottom margin is height of extra white space to prevent extra space around ad */<br />
}</p>
<p>.adsense468&#215;60 iframe {<br />
    height: 65px;  /* height of 468&#215;60 ad + extra white space */<br />
    width: 468px; /* width of 468&#215;60 ad */<br />
}</p>
<p>/* turn off the covering div for IE */<br />
* html .adsense468&#215;60hack {<br />
    height: 0px;<br />
    width: 0px;<br />
    background-color: transparent;<br />
    top:0px;<br />
}</p>
<p>/* bring ad back to regular size for IE, remove extra space that is for some reason introduced */<br />
* html .adsense468&#215;60 {<br />
    height:60px;<br />
    margin: 0 auto -20px auto;<br />
}</p>
<p>/* bring ad back to regular size for IE */<br />
* html .adsense468&#215;60 iframe {<br />
    height: 60px;<br />
}</p>
<p>728&#215;90 html:</p>
<p>728&#215;90 css:</p>
<p>.adsense728&#215;90hack {<br />
    height: 7px; /* dimension of the area you need to cover */<br />
    width: 728px; /* dimension of the area you need to cover */<br />
    background-color: #124F7D; /* color/image you are using to cover the white */<br />
    position:relative;<br />
    top:-11px; /* move the cover into place, change if you change the height */<br />
}</p>
<p>.adsense728&#215;90 {<br />
    width: 728px; /* width of 728&#215;90 ad */<br />
    height:96px; /* height of 728&#215;90 ad + extra white space */<br />
    margin: 0 auto -7px auto; /* negative bottom margin is height of extra white space to prevent extra space around ad */<br />
}</p>
<p>.adsense728&#215;90 iframe {<br />
    height: 96px;  /* height of 728&#215;90 ad + extra white space */<br />
    width: 728px; /* width of 728&#215;90 ad */<br />
}</p>
<p>/* turn off the covering div for IE */<br />
* html .adsense728&#215;90hack {<br />
    height: 0px;<br />
    width: 0px;<br />
    background-color: transparent;<br />
    top:0px;<br />
}</p>
<p>/* bring ad back to regular size for IE, remove extra space that is for some reason introduced */<br />
* html .adsense728&#215;90 {<br />
    height:90px;<br />
    margin: 0 auto -20px auto;<br />
}</p>
<p>/* bring ad back to regular size for IE */<br />
* html .adsense728&#215;90 iframe {<br />
    height: 90px;<br />
}</p>
<p>468&#215;15 html:</p>
<p>468&#215;15 css:</p>
<p>.adsense468&#215;15 {<br />
    width: 468px; /* width of 468&#215;15 ad */<br />
    height:19px; /* height of 468&#215;15 ad + extra white space */<br />
    margin: 0 auto 0 auto; /* negative bottom margin is height of extra white space to prevent extra space around ad */</p>
<p>}</p>
<p>.adsense468&#215;15 iframe {<br />
    height: 19px;  /* height of 468&#215;15 ad + extra white space */<br />
    width: 468px; /* width of 468&#215;15 ad */<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nick</title>
		<link>http://nickwilsdon.com/google-adsense-scrolling-fix/comment-page-1/#comment-39</link>
		<dc:creator>Nick</dc:creator>
		<pubDate>Fri, 14 Oct 2005 07:43:52 +0000</pubDate>
		<guid isPermaLink="false">http://www.e3internet.com/greenhouse/nick/03/05/2005/google-adsense-scrolling-fix/#comment-39</guid>
		<description>No  Robyn, floating wouldn&#039;t help. It&#039;s down to the slightly buggy Google window and the way Firefox handles overflow. 

By the way if you want a great course on CSS, then I would recommmend taking a trip over to http://www.htmldog.com and following the links on the top left. 

That&#039;s the primer I use with all my new staff and covers the subject extremely well.

</description>
		<content:encoded><![CDATA[<p>No  Robyn, floating wouldn&#8217;t help. It&#8217;s down to the slightly buggy Google window and the way Firefox handles overflow. </p>
<p>By the way if you want a great course on CSS, then I would recommmend taking a trip over to <a href="http://www.htmldog.com" rel="nofollow">http://www.htmldog.com</a> and following the links on the top left. </p>
<p>That&#8217;s the primer I use with all my new staff and covers the subject extremely well.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Cody</title>
		<link>http://nickwilsdon.com/google-adsense-scrolling-fix/comment-page-1/#comment-38</link>
		<dc:creator>Cody</dc:creator>
		<pubDate>Fri, 14 Oct 2005 07:41:59 +0000</pubDate>
		<guid isPermaLink="false">http://www.e3internet.com/greenhouse/nick/03/05/2005/google-adsense-scrolling-fix/#comment-38</guid>
		<description>Yes, my website was taken down. It was primarily a webcomic I made with a friend, and he was unable to continue. Here is my contribution to this fix, quickly copy and pasted out of my forum archive:
-----------------------------------------------------------------
About

There is a bug in Google Adsense, where under Gecko browsers (Firefox, Mozilla, Netscape, etc) you can scroll an ad a few pixels past its regular display. I&#039;m not sure if this occurs on all ads, but it definitely occurs on the 728x90, 468x60, and 468x15 units that I use on this site.

Besides being ugly, this has the side effect of trapping a users mouse briefly if they are scrolling the page and their mouse enters an ad.

I have read on the web many people who have submitted this as a bug to Google. I have not yet, but they won&#039;t do anything about it. How long have we been complaining about xhtml+xml support?

In searching the web for a fix, I came across this article:
http://www.e3internet.com/greenhouse/ni … lling-fix/

It contains a fix, a fix I didn&#039;t like for the following reasons:
1. Required modification to Google&#039;s code (insignificant, yet against the TOS)
2. Used browser sniffing.
3. Required Javascript.

It was, however, enough to get my juices flowing. I&#039;ve spent the last 4 hours tinkering around, and have come up with a hack that is pure CSS and does not alter a single piece of the Google code. I still thank Nick Wilsdon from the above link for the inspiration, and the technique I use is extremely similar.

It fixes the bug in gecko browsers (Mozilla, Firefox, and Netscape), and remains working in IE. The fix does not work in Opera where a bug prevents it from working, instead several (4-6) pixels of white will appear under the ad in Opera. For me, it is a worthwile compromise, because gecko based browsers have around 60% usage on my site while Opera has around 1%. I have had zero success, and believe its impossible, to work around the z-index bug in Opera that causes this fix to not work.

Furthermore, I am sharing this fix and you can feel free to give feedback, perhaps we can improve it further!

One other thing. Across the web there are people blaming this on Firefox and other people blaming it on Google. My point of view: they are both at fault. Firefox could probably be handling overflow:hidden better in some way. Google should have constructed the iframe (if an iframe is even really necessary) to actually be the size it claims.

The Fix

There are two steps to the fix. The first is to get the scrolling to stop by showing the full iframe. If your page has a white background, you can stop here, as the few extra pixels shown at the bottom of the ad are white. If your background is not white, we create a strip of color to cover up the white with the color (or bg image) of your choice.

I started by looking at the code within the iframes. It didn&#039;t lead me anywhere, but it does reveal the source of some of our problems. Here is an example ad from my site:
http://www.pixeljunkies.com/public/goog … ample.html
I have applied source formatting so the source is easier to view, and edited the links to go nowhere.

Looking at it makes me cringe. I know the guys at Google can write good code, but why don&#039;t they? So this mess shows a couple of things. First, it is 5am, but I&#039;m not sure the pixels add up to the 60px tall this unit is supposed to be. Second, the white background that gives us all this trouble. If Google simply made the background color on the body the same as the &quot;google_color_border&quot; color, we could simply only use the first step of the fix.

I have only made fixes for the ad types I use, but by looking at them you can probably adapt it to other types.

468x60






and apply this CSS:

.adsense468x60hack {
    height: 6px; /* dimension of the area you need to cover */
    width: 468px; /* dimension of the area you need to cover */
    background-color: #124F7D; /* color/image you are using to cover the white */
    position:relative;
    top:-10px; /* move the cover into place, change if you change the height */
}

.adsense468x60 {
    width: 468px; /* width of 468x60 ad */
    height:65px; /* height of 468x60 ad + extra white space */
    margin: 0 auto -6px auto; /* negative bottom margin is height of extra white space to prevent extra space around ad */
}

.adsense468x60 iframe {
    height: 65px;  /* height of 468x60 ad + extra white space */
    width: 468px; /* width of 468x60 ad */
}

/* turn off the covering div for IE */
* html .adsense468x60hack {
    height: 0px;
    width: 0px;
    background-color: transparent;
    top:0px;
}

/* bring ad back to regular size for IE, remove extra space that is for some reason introduced */
* html .adsense468x60 {
    height:60px;
    margin: 0 auto -20px auto;
}

/* bring ad back to regular size for IE */
* html .adsense468x60 iframe {
    height: 60px;
}

728x90






.adsense728x90hack {
    height: 7px; /* dimension of the area you need to cover */
    width: 728px; /* dimension of the area you need to cover */
    background-color: #124F7D; /* color/image you are using to cover the white */
    position:relative;
    top:-11px; /* move the cover into place, change if you change the height */
}

.adsense728x90 {
    width: 728px; /* width of 728x90 ad */
    height:96px; /* height of 728x90 ad + extra white space */
    margin: 0 auto -7px auto; /* negative bottom margin is height of extra white space to prevent extra space around ad */
}

.adsense728x90 iframe {
    height: 96px;  /* height of 728x90 ad + extra white space */
    width: 728px; /* width of 728x90 ad */
}

/* turn off the covering div for IE */
* html .adsense728x90hack {
    height: 0px;
    width: 0px;
    background-color: transparent;
    top:0px;
}

/* bring ad back to regular size for IE, remove extra space that is for some reason introduced */
* html .adsense728x90 {
    height:90px;
    margin: 0 auto -20px auto;
}

/* bring ad back to regular size for IE */
* html .adsense728x90 iframe {
    height: 90px;
}

468x15

This size only needs to be expanded, as the color contained within the extra pixels is the color that is set by your adsense border color.





and apply this CSS:

.adsense468x15 {
    width: 468px; /* width of 468x15 ad */
    height:19px; /* height of 468x15 ad + extra white space */
    margin: 0 auto 0 auto; /* negative bottom margin is height of extra white space to prevent extra space around ad */

}

.adsense468x15 iframe {
    height: 19px;  /* height of 468x15 ad + extra white space */
    width: 468px; /* width of 468x15 ad */
}

What the hack does

I am expanding the ad iframe to be the full size it really is, and creating a div to cover up the white. I use positioning rather then negative margins like Nick did because the negative margins gave me more problems.

While technically IE should understand this CSS, it doesn&#039;t. Probably because it is buying the height the iframe is claiming. If left as is, the cover up div covers more then it should in IE, plus the whole thing takes up more space. The * html rules (which is a rule only IE applies) take away the cover up div for IE, and correct the spacing problems implemented in IE by this fix.

What about XHTML+XML
For those of you using the method of making adsense work when the document is sent as an XHTML+XML mimetype using an object, like this:
http://keystonewebsites.com/articles/adsense.php

You will find that this does not help you. I&#039;ve tried to get it to work when it is included as an object, but I can&#039;t. It&#039;s weird, It seems to me that just telling the object to be 65px high rather then 60 would work, but it doesn&#039;t want to. This proves that the few pixels of scrolling is taking place within the included Google page, not in the object/iframe.

I am not concerned, as I am currently not using this method. I have found that while your pages are still targeted, if you have multiple ads they all show the same content, the object method stops the Adsense multiple ad algorithm from working.

Can anyone else figure out a way to get this to work with the object method?

Browser Support

Testing the newest code:

IE7: Wont test until out of beta. IE7 doesn&#039;t parse * html rules so unless it nails the positioning the first time it might not get it right. I&#039;ll deal with it when IE7 is out of beta.
IE6: Perfect.
IE5.5: Perfect.
IE5: Perfect.
Firefox/Netscape/Mozilla: Perfect.
Opera 8/7: A few pixels of white beneath ad due to a z-index bug that has no known workaround and is confirmed fix in an upcoming version of Opera.

Firefox/Camino on Mac: Perfect.
Safari: Perfect. (beware that Safari doesn&#039;t always show a bg color the same as an image with that color in it, so if you have a bg image and are trying to use a bg color in the cover up div, their might be a difference in the shade of color in Safari. This can be worked around by using a bg image in the cover up div.)

I don&#039;t support 4.X browsers on my site so I haven&#039;t even checked. I also dont support and thus havent checked Mac IE.

Shortcomings

The only shortcomings are inherent in the fix. The cover up div can easily match a background color or even simple background graphic, but if you have a complex background graphic it will be hard to construct a cover up div that looks seemless. Obviously, you cant set the cover up div to transparent because then it wont cover up the white we are trying to cover.

I think this fix is the best we can possibly do until Google actually fixes the bug themselves. In the meantime, everybody email Google&#039;s Adsense team about the bug and give this fix to anyone you know suffering from it.

Feel free to comment below with any problems, suggestions, or whatever! Hope this bit of code is useful to you.</description>
		<content:encoded><![CDATA[<p>Yes, my website was taken down. It was primarily a webcomic I made with a friend, and he was unable to continue. Here is my contribution to this fix, quickly copy and pasted out of my forum archive:<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
About</p>
<p>There is a bug in Google Adsense, where under Gecko browsers (Firefox, Mozilla, Netscape, etc) you can scroll an ad a few pixels past its regular display. I&#8217;m not sure if this occurs on all ads, but it definitely occurs on the 728&#215;90, 468&#215;60, and 468&#215;15 units that I use on this site.</p>
<p>Besides being ugly, this has the side effect of trapping a users mouse briefly if they are scrolling the page and their mouse enters an ad.</p>
<p>I have read on the web many people who have submitted this as a bug to Google. I have not yet, but they won&#8217;t do anything about it. How long have we been complaining about xhtml+xml support?</p>
<p>In searching the web for a fix, I came across this article:<br />
<a href="http://www.e3internet.com/greenhouse/ni" rel="nofollow">http://www.e3internet.com/greenhouse/ni</a> … lling-fix/</p>
<p>It contains a fix, a fix I didn&#8217;t like for the following reasons:<br />
1. Required modification to Google&#8217;s code (insignificant, yet against the TOS)<br />
2. Used browser sniffing.<br />
3. Required Javascript.</p>
<p>It was, however, enough to get my juices flowing. I&#8217;ve spent the last 4 hours tinkering around, and have come up with a hack that is pure CSS and does not alter a single piece of the Google code. I still thank Nick Wilsdon from the above link for the inspiration, and the technique I use is extremely similar.</p>
<p>It fixes the bug in gecko browsers (Mozilla, Firefox, and Netscape), and remains working in IE. The fix does not work in Opera where a bug prevents it from working, instead several (4-6) pixels of white will appear under the ad in Opera. For me, it is a worthwile compromise, because gecko based browsers have around 60% usage on my site while Opera has around 1%. I have had zero success, and believe its impossible, to work around the z-index bug in Opera that causes this fix to not work.</p>
<p>Furthermore, I am sharing this fix and you can feel free to give feedback, perhaps we can improve it further!</p>
<p>One other thing. Across the web there are people blaming this on Firefox and other people blaming it on Google. My point of view: they are both at fault. Firefox could probably be handling overflow:hidden better in some way. Google should have constructed the iframe (if an iframe is even really necessary) to actually be the size it claims.</p>
<p>The Fix</p>
<p>There are two steps to the fix. The first is to get the scrolling to stop by showing the full iframe. If your page has a white background, you can stop here, as the few extra pixels shown at the bottom of the ad are white. If your background is not white, we create a strip of color to cover up the white with the color (or bg image) of your choice.</p>
<p>I started by looking at the code within the iframes. It didn&#8217;t lead me anywhere, but it does reveal the source of some of our problems. Here is an example ad from my site:<br />
<a href="http://www.pixeljunkies.com/public/goog" rel="nofollow">http://www.pixeljunkies.com/public/goog</a> … ample.html<br />
I have applied source formatting so the source is easier to view, and edited the links to go nowhere.</p>
<p>Looking at it makes me cringe. I know the guys at Google can write good code, but why don&#8217;t they? So this mess shows a couple of things. First, it is 5am, but I&#8217;m not sure the pixels add up to the 60px tall this unit is supposed to be. Second, the white background that gives us all this trouble. If Google simply made the background color on the body the same as the &#8220;google_color_border&#8221; color, we could simply only use the first step of the fix.</p>
<p>I have only made fixes for the ad types I use, but by looking at them you can probably adapt it to other types.</p>
<p>468&#215;60</p>
<p>and apply this CSS:</p>
<p>.adsense468&#215;60hack {<br />
    height: 6px; /* dimension of the area you need to cover */<br />
    width: 468px; /* dimension of the area you need to cover */<br />
    background-color: #124F7D; /* color/image you are using to cover the white */<br />
    position:relative;<br />
    top:-10px; /* move the cover into place, change if you change the height */<br />
}</p>
<p>.adsense468&#215;60 {<br />
    width: 468px; /* width of 468&#215;60 ad */<br />
    height:65px; /* height of 468&#215;60 ad + extra white space */<br />
    margin: 0 auto -6px auto; /* negative bottom margin is height of extra white space to prevent extra space around ad */<br />
}</p>
<p>.adsense468&#215;60 iframe {<br />
    height: 65px;  /* height of 468&#215;60 ad + extra white space */<br />
    width: 468px; /* width of 468&#215;60 ad */<br />
}</p>
<p>/* turn off the covering div for IE */<br />
* html .adsense468&#215;60hack {<br />
    height: 0px;<br />
    width: 0px;<br />
    background-color: transparent;<br />
    top:0px;<br />
}</p>
<p>/* bring ad back to regular size for IE, remove extra space that is for some reason introduced */<br />
* html .adsense468&#215;60 {<br />
    height:60px;<br />
    margin: 0 auto -20px auto;<br />
}</p>
<p>/* bring ad back to regular size for IE */<br />
* html .adsense468&#215;60 iframe {<br />
    height: 60px;<br />
}</p>
<p>728&#215;90</p>
<p>.adsense728&#215;90hack {<br />
    height: 7px; /* dimension of the area you need to cover */<br />
    width: 728px; /* dimension of the area you need to cover */<br />
    background-color: #124F7D; /* color/image you are using to cover the white */<br />
    position:relative;<br />
    top:-11px; /* move the cover into place, change if you change the height */<br />
}</p>
<p>.adsense728&#215;90 {<br />
    width: 728px; /* width of 728&#215;90 ad */<br />
    height:96px; /* height of 728&#215;90 ad + extra white space */<br />
    margin: 0 auto -7px auto; /* negative bottom margin is height of extra white space to prevent extra space around ad */<br />
}</p>
<p>.adsense728&#215;90 iframe {<br />
    height: 96px;  /* height of 728&#215;90 ad + extra white space */<br />
    width: 728px; /* width of 728&#215;90 ad */<br />
}</p>
<p>/* turn off the covering div for IE */<br />
* html .adsense728&#215;90hack {<br />
    height: 0px;<br />
    width: 0px;<br />
    background-color: transparent;<br />
    top:0px;<br />
}</p>
<p>/* bring ad back to regular size for IE, remove extra space that is for some reason introduced */<br />
* html .adsense728&#215;90 {<br />
    height:90px;<br />
    margin: 0 auto -20px auto;<br />
}</p>
<p>/* bring ad back to regular size for IE */<br />
* html .adsense728&#215;90 iframe {<br />
    height: 90px;<br />
}</p>
<p>468&#215;15</p>
<p>This size only needs to be expanded, as the color contained within the extra pixels is the color that is set by your adsense border color.</p>
<p>and apply this CSS:</p>
<p>.adsense468&#215;15 {<br />
    width: 468px; /* width of 468&#215;15 ad */<br />
    height:19px; /* height of 468&#215;15 ad + extra white space */<br />
    margin: 0 auto 0 auto; /* negative bottom margin is height of extra white space to prevent extra space around ad */</p>
<p>}</p>
<p>.adsense468&#215;15 iframe {<br />
    height: 19px;  /* height of 468&#215;15 ad + extra white space */<br />
    width: 468px; /* width of 468&#215;15 ad */<br />
}</p>
<p>What the hack does</p>
<p>I am expanding the ad iframe to be the full size it really is, and creating a div to cover up the white. I use positioning rather then negative margins like Nick did because the negative margins gave me more problems.</p>
<p>While technically IE should understand this CSS, it doesn&#8217;t. Probably because it is buying the height the iframe is claiming. If left as is, the cover up div covers more then it should in IE, plus the whole thing takes up more space. The * html rules (which is a rule only IE applies) take away the cover up div for IE, and correct the spacing problems implemented in IE by this fix.</p>
<p>What about XHTML+XML<br />
For those of you using the method of making adsense work when the document is sent as an XHTML+XML mimetype using an object, like this:<br />
<a href="http://keystonewebsites.com/articles/adsense.php" rel="nofollow">http://keystonewebsites.com/articles/adsense.php</a></p>
<p>You will find that this does not help you. I&#8217;ve tried to get it to work when it is included as an object, but I can&#8217;t. It&#8217;s weird, It seems to me that just telling the object to be 65px high rather then 60 would work, but it doesn&#8217;t want to. This proves that the few pixels of scrolling is taking place within the included Google page, not in the object/iframe.</p>
<p>I am not concerned, as I am currently not using this method. I have found that while your pages are still targeted, if you have multiple ads they all show the same content, the object method stops the Adsense multiple ad algorithm from working.</p>
<p>Can anyone else figure out a way to get this to work with the object method?</p>
<p>Browser Support</p>
<p>Testing the newest code:</p>
<p>IE7: Wont test until out of beta. IE7 doesn&#8217;t parse * html rules so unless it nails the positioning the first time it might not get it right. I&#8217;ll deal with it when IE7 is out of beta.<br />
IE6: Perfect.<br />
IE5.5: Perfect.<br />
IE5: Perfect.<br />
Firefox/Netscape/Mozilla: Perfect.<br />
Opera 8/7: A few pixels of white beneath ad due to a z-index bug that has no known workaround and is confirmed fix in an upcoming version of Opera.</p>
<p>Firefox/Camino on Mac: Perfect.<br />
Safari: Perfect. (beware that Safari doesn&#8217;t always show a bg color the same as an image with that color in it, so if you have a bg image and are trying to use a bg color in the cover up div, their might be a difference in the shade of color in Safari. This can be worked around by using a bg image in the cover up div.)</p>
<p>I don&#8217;t support 4.X browsers on my site so I haven&#8217;t even checked. I also dont support and thus havent checked Mac IE.</p>
<p>Shortcomings</p>
<p>The only shortcomings are inherent in the fix. The cover up div can easily match a background color or even simple background graphic, but if you have a complex background graphic it will be hard to construct a cover up div that looks seemless. Obviously, you cant set the cover up div to transparent because then it wont cover up the white we are trying to cover.</p>
<p>I think this fix is the best we can possibly do until Google actually fixes the bug themselves. In the meantime, everybody email Google&#8217;s Adsense team about the bug and give this fix to anyone you know suffering from it.</p>
<p>Feel free to comment below with any problems, suggestions, or whatever! Hope this bit of code is useful to you.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Robyn</title>
		<link>http://nickwilsdon.com/google-adsense-scrolling-fix/comment-page-1/#comment-37</link>
		<dc:creator>Robyn</dc:creator>
		<pubDate>Fri, 14 Oct 2005 07:37:48 +0000</pubDate>
		<guid isPermaLink="false">http://www.e3internet.com/greenhouse/nick/03/05/2005/google-adsense-scrolling-fix/#comment-37</guid>
		<description>Is there a way I can just not do &#039;float&#039; or does that have nothing to do with it?

I am exposing my extremely limited css skills here LOL</description>
		<content:encoded><![CDATA[<p>Is there a way I can just not do &#8216;float&#8217; or does that have nothing to do with it?</p>
<p>I am exposing my extremely limited css skills here LOL</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nick</title>
		<link>http://nickwilsdon.com/google-adsense-scrolling-fix/comment-page-1/#comment-36</link>
		<dc:creator>Nick</dc:creator>
		<pubDate>Fri, 14 Oct 2005 07:30:18 +0000</pubDate>
		<guid isPermaLink="false">http://www.e3internet.com/greenhouse/nick/03/05/2005/google-adsense-scrolling-fix/#comment-36</guid>
		<description>Blimey you&#039;re right, looked like he&#039;s forgotten to put some coins in the meter ;)

&lt;blockquote&gt;Anyway, I have another one, gamingandtech.com that has more normal sized text,&lt;/blockquote&gt;

Ah I don&#039;t mean the size of the text on the page, it&#039;s the text size that you have set in the browser that affects it. The View &gt; text size option. The 5px we put in is a static number so of course if you increase the text size you would need 6+ for the height. I couldn&#039;t use a dynamic number for height (em/%) so it can&#039;t adapt to these changes. 

I settled with the 5px as that seemed to fix the problem for the &#039;normal&#039; text size. So try putting it in to your code and changing your text size in the browser.</description>
		<content:encoded><![CDATA[<p>Blimey you&#8217;re right, looked like he&#8217;s forgotten to put some coins in the meter ;)</p>
<blockquote><p>Anyway, I have another one, gamingandtech.com that has more normal sized text,</p></blockquote>
<p>Ah I don&#8217;t mean the size of the text on the page, it&#8217;s the text size that you have set in the browser that affects it. The View &gt; text size option. The 5px we put in is a static number so of course if you increase the text size you would need 6+ for the height. I couldn&#8217;t use a dynamic number for height (em/%) so it can&#8217;t adapt to these changes. </p>
<p>I settled with the 5px as that seemed to fix the problem for the &#8216;normal&#8217; text size. So try putting it in to your code and changing your text size in the browser.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Robyn</title>
		<link>http://nickwilsdon.com/google-adsense-scrolling-fix/comment-page-1/#comment-35</link>
		<dc:creator>Robyn</dc:creator>
		<pubDate>Fri, 14 Oct 2005 07:18:04 +0000</pubDate>
		<guid isPermaLink="false">http://www.e3internet.com/greenhouse/nick/03/05/2005/google-adsense-scrolling-fix/#comment-35</guid>
		<description>that link above to Cody&#039;s page is a little weird...  Takes me to:

GAME OVER
To continue, insert freedom of speech.

Odd ;)  Anyway, I have another one, gamingandtech.com that has more normal sized text, but I can&#039;t try it there because the bkgrnd is black.  I guess I&#039;ll just remove the adsense from above the fold, so to speak.

See you online :)</description>
		<content:encoded><![CDATA[<p>that link above to Cody&#8217;s page is a little weird&#8230;  Takes me to:</p>
<p>GAME OVER<br />
To continue, insert freedom of speech.</p>
<p>Odd ;)  Anyway, I have another one, gamingandtech.com that has more normal sized text, but I can&#8217;t try it there because the bkgrnd is black.  I guess I&#8217;ll just remove the adsense from above the fold, so to speak.</p>
<p>See you online :)</p>
]]></content:encoded>
	</item>
</channel>
</rss>
