Overflow: Auto Problem / Bug In IE
Sunday, March 16th, 2008Another quick bug fix for you. Another little quirk about Internet Explorer is the way in renders the
First of all, if a width is not specified for the given element, IE will treat it like

In order to fix this you need to create a stylesheet just for IE (That’s explained in the last half of this article if you don’t know how to do that). Once you’ve done that, add the following styles to the IE-only stylesheet, where “.element” is the class of the element you’re working with:
.element { overflow-y: auto; overflow-x: visible; width: 450px; }
IE understands
Once you do this, you’ll notice this problem:

Ok, IE, you’ve really outdone yourself on stupidity this time. It looks like IE is not taking the scrollbar into account in the height of the element. So, now we need to fix that by adding padding-bottom: 20px; to the IE-only stylesheet, and here’s what we get:
.element { overflow-y: auto; overflow-x: visible; width: 450px; padding-bottom: 20px; }

Voila! Problem solved. Keep in mind, this isn’t a perfect solution…the problem with this is that IE will add that 20px padding at the bottom of the element even if there isn’t a scrollbar, leaving you with some extra space on the bottom of your element in this case. It’s usually not a big deal, but if anyone knows of an easy fix for this I’m all ears.




