Saturday, July 2, 2011

When overflow: hidden Doesn’t Hide in IE (lte IE7)

Source: http://www.defusion.org.uk/archives/2007/04/02/when-overflow-hidden-doesnt-hide-in-ie/
Snapshot: July 03, 2011, 12:03 AM

Intro: I’ve come across this problem before, where I want to hide the overflow of an element, this works fine in all browsers except IE – however it’s never been a problem in anything that I’ve progressed far enough with to worry about fixing it for IE.
Well this evening I came across the problem again, and found the solution – IE (lte 7) doesn’t like it when you have a position: relative; on the child (or possibly children) of an element which you have declared overflow: hidden;.
So in my case swapping that out for position: absolute; on the child andoverflow: hidden; position: relative; on the parent worked a charm. NowIE plays nicely like its other browser friends.

No comments:

Post a Comment