How to make a web page render LIKE it is running in IEs Compatibility Mode even though it isn't?

StackOverflow https://stackoverflow.com/questions/3380897

سؤال

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?

هل كانت مفيدة؟

المحلول

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" />
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top