Forum Moderators: not2easy

Message Too Old, No Replies

Zoom - what does it actually do?

         

Wlauzon

3:34 am on Apr 29, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I am finally updating some of the CSS in our ecommerce site, and some of the default CSS has a few statements like:

#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).

Setek

7:19 am on Apr 29, 2008 (gmt 0)

10+ Year Member



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.

Wlauzon

4:21 pm on Apr 29, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Apparently this has been changed in IE8, so the main reason for my question is what (if any) effect will this have in IE8?

[msdn2.microsoft.com...]

SuzyUK

4:49 pm on Apr 29, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



it *should* have no detrimental effect in IE8.. but

>>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]

Wlauzon

8:44 pm on Apr 29, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thanks Suzy - I am trying to avoid any and all hacks that I can, since they eventually seem to cause problems somewhere.

Now I just need to figure out what conditionals to use - looks like something simple like: lt IE8 should work.

poppyrich

7:14 pm on Apr 30, 2008 (gmt 0)

10+ Year Member



@suzy
.. 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.