Forum Moderators: not2easy
#info-div{
background-color:#FFFFFF;
padding:0px;
zoom:1;
}
What exactly is the purpose of the zoom:1 ?
Searching around it appears to be an early hack for IE7, but it is also supposed to be part of CSS3 (if that ever comes out).
zoom: 1.0; is a hack that triggers hasLayout in IE (6 & 7 are what I know of, but possibly earlier versions too.) If you had a
div that disappears randomly on refresh, or is cut in half, or you just wanted a parent element to acknowledge its floating children, you use zoom. If you go
zoom: 2.0; you'll notice everything getting big on you.
[msdn2.microsoft.com...]
>>What does it do
zoom [msdn2.microsoft.com]is a proprietary MS property that means you could specify the zoom of text magnification - 1 being 100% (i.e. normal), this is its purpose.
The fact that it is also a hasLayout triggering property is/was a bonus - and where the hack usage comes in.
zoom: 1; does nothing to the text magnification and is why is considered safe to use regards hasLayout. The fact that
zoom: 1; technically does nothing (except for hasLayout, therefore only IE5/6/7) means it *should* have no detrimental effect when left in the main CSS file, and that should continue to be true of IE8, the value of 1 will do nothing to the text-magnification and it should no longer set hasLayout - however I would still advise putting it in a conditional so it can be relegated as soon as possible, like all 'good' hacks and just to make sure future weirdness does not occur. .. I was wondering if the problems with the new IE zoom feature aren't related to the CSS zoom being messed with?
[edited by: SuzyUK at 4:50 pm (utc) on April 29, 2008]
.. I was wondering if the problems with the new IE zoom feature aren't related to the CSS zoom being messed with?
As far as I've been able to tell, they don't seem to be related.
IE7's Zoom is just a very, very flawed implementation.
Certainly not tested as it should have been and, in IE8, the zoom feature is changing to what MS calls an "Adaptive Zoom" which also changes the layout as it enlarges.