开发者

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

开发者 https://www.devze.com 2023-01-09 13:37 出处:网络
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

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 correct开发者_开发知识库ly 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" />
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号