Forum Moderators: open

Message Too Old, No Replies

IE7 Zoom feature breaking layout

IE7's Zoom Feature is breaking the footer position.

         

gcarn

7:38 pm on Apr 9, 2008 (gmt 0)

10+ Year Member



Hi,
So on one of my sites, I have noticed that when you use IE7's zoom feature, and zoom OUT of the site, my footer div no longer resides at the bottom of my page, but instead it goes up into the content of the document.

From what i can tell my code, css and html seem clean.. and this error does not show up with firefox 3's beta resize feature.

Id link the site so you can all see exactly what i mean, but i beleive that is a no-no here...

has anyone expereieced anything like this, or does anyone have any suggestions on what could make this happen?

SuzyUK

7:33 am on Apr 10, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi gcarn

thanks for the link, just for follow up..

This is an IE7 "feature" (Bug!) where when you have positioned elements, with hasLayout - this would usually be any 'column' in a layout with position: relative; and a width!

when you use the zoom, either way, in such a layout it will cause elements to overlap using "zoom in" or gap using "zoom out" - this is because IE applies extra margins, it applies negative ones for the zoom in!

IE7 can't cope unless a parent, ancestor element is also positioned so in your case adding

position: relative;
to the body element stabilised it

Your footer was the symptom, the "overlap" was actually happening on each of your relatively positioned divs so by the time it was applied to all your columns the colored footer showed the biggest difference in position.

If the zoom was positive it was doing the same only making a gap rather than overlapping.

hth and thanks for the sample I knew there was something with hasLayout and zoom just couldn't narrow it down..

-Suzy

gcarn

3:10 pm on Apr 10, 2008 (gmt 0)

10+ Year Member



Wow
Thats a great explanation of what was happening.
I just learned something new!
Thanks a whole lot!

SuzyUK

4:00 pm on Apr 10, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You're Welcome!

btw in my post above I have zoom in/out the wrong way around :o

zoom out - (smaller than 100%) - as you say causes negative margins/overlaps,
zoom in - (larger than 100%) causes positive margins/gaps

-Suzy

[edited by: SuzyUK at 4:00 pm (utc) on April 10, 2008]