New here? Start with the essentials and go from there.

Monday, May 19, 2008

Fun Fact: zoom: 1 Gives “hasLayout” in IE

I only just a few days ago discovered zoom: 1, the fun fun CSS attribute hack to force an element to hasLayout in Internet Explorer. (Alternative methods are floating or using height: 1%.)

For whatever reason, my IE hammer toolbox up to this point had been limited to position: relative, and I hadn’t delved into hasLayout as a solution at all. With zoom: 1 I (and you, I suppose) now have a second “well, let’s see if this works” option for getting a hidden or mis-aligned element to appear correctly in IE.

For a good summary of hasLayout and it what it’s good for, read “On having layout.” There’s also the very good “How To Attack An Internet Explorer Display Bug” article, which is quite thorough.

0 comments:

Post a Comment

Blog Widget by LinkWithin