0

I have been pulling my hair out over the past few days with a div in that does not stretch across the entire width of the screen like it should. Works fine in Firefox, but in IE (IE8 to be specific) it will not render correctly unless it is in Compatibility Mode. If the page renders correctly in Compatibility Mode there has to be some hack or workaround that will also make it render correctly when not in Compatibility Mode.

This also brings up a last resort question for me, how do I force a page to load in Compatibility Mode without user intervention?

I would like to avoid using Compatibility Mode though because it breaks my JavaScript, so I will have to modify my JavaScript if Compatibility Mode is used.

Any thoughts?

ubiquibacon
  • 10,451
  • 28
  • 109
  • 179
  • 2
    IE7 (compatibility mode) is the one that's broken. It's likely there's a legitimate css issue if it's not rendering in IE8 [and isn't about rounded corners :)]. Why not post the relevant css and markup? – Rob Aug 01 '10 at 06:02
  • possible duplicate of [Div width problem in IE](http://stackoverflow.com/questions/3367956/div-width-problem-in-ie) – msw Aug 01 '10 at 06:44
  • @Rob, IE8 is the only browser that messes up. Opera, Firefox, and Crome all work perfect. If you still think it is a CSS issue I will post my code. @msw, though I am dealing with the same issue, I am not asking the same question, thus this is not a duplicate. – ubiquibacon Aug 01 '10 at 07:28

1 Answers1

2

I would suggest using the IE Developer Toolbar that comes installed in IE8 by default. It should help you troubleshoot your issue.

Adding this meta tag will also force IE8 to emulate IE7:

<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
rickp
  • 854
  • 8
  • 10
  • This will (apparently) break his Javascript. – SLaks Aug 01 '10 at 05:56
  • @SLaks: I realize he said it does, but he did ask how it was possible as a 'last resort'. I agree 100% with Rob as well, an example would be ideal. – rickp Aug 01 '10 at 06:09
  • Though this will break my JavaScript, it is helpful to know how to do it, so thanks. The specific issue and code I am dealing with can be found in one of my other questions located here: http://stackoverflow.com/questions/3367956/div-width-problem-in-ie – ubiquibacon Aug 01 '10 at 07:34