Search code examples
htmlinternet-explorer-7inline-styles

IE7 automatically setting inline style height


Here's my deal: The boss asked me to fix a page not displaying properly in IE7.

I'm working with a div tag initially set as:

<div id="login_content" style="left: 0px; text-align: center;">

And so it is rendered in Firefox, Chrome, Safari, and IE9. The issue comes in IE7--somehow the div is cut off when IE7 automagically decides to set the inline style with a height of 8px.

There are no scripts that modify this (as I said, it doesn't get touched in other modern browsers) and upon inspection with IE9 developer tools, it's not inherited from a style sheet. Does anyone know what might cause this behavior?

Screencap of IE7 rendered div in developer tools


Solution

  • If it's running through an external script it's probably an inline style in that. If you post a link we can use inspection tools.

    You can use the conditional <!--[if IE7] code to fix it [endif]--> to just change how it renders on IE7.