views:

56

answers:

1

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?

+1  A: 

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
This will (apparently) break his Javascript.
SLaks
@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
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
typoknig