My website has a really strange width bug in IE7. The site is fixed-width, optimized for 1024x768, with the site's content centered in the viewport. Obviously, if the viewport is smaller than 1024, then I get horizontal scrolling, but the strangest thing is that, for some reason, if I widen the window past 1000 px, extra space gets added to the right of the site's contents, and that extra space gets much larger, the wider I make the window.

Has anyone ever had this kind of problem in IE7? The site looks fine in FF, Safari, Opera, and IE8.

4 answers

4
points
This was chosen as the best answer

Hello Hannah, Here's the fix, add this to the body:

body{position:relative; overflow:hidden}

You can add it between conditional comments so it only applies to IE7

Answered over 7 years ago by Ionut Popa
  • Ionut Popa, if I could give you +1,000,000,000 points for this, I totally would. Jon over 7 years ago
0
points

Thanks for the fix. Out of curiosity, why is this happening? I never had this issue before with similarly-structured sites.

Answered over 7 years ago by Hannah Hu
0
points

It's a strange bug, i've seen it before; i don't have a logical explanation and there isn't one for the majority of bugs in IE.

Answered over 7 years ago by Ionut Popa
Glen 0
0
points

Thanks for this!

We had a page that started acting like this in IE7 - when javascript updated the src of an image, the page would suddenly gain about 60% width!

Adding just body{overflow:hidden} solved it.

Answered about 6 years ago by Glen