Ensuring strict mode in IE 8 - internet-explorer-8

I'm apparently triggering quirks mode (or at least IE 7 standards mode) even though I've added the strict doctype:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
and the IE compatibility list meta:
<meta http-equiv="X-UA-Compatible" content="IE=8" />
I've looked at the Developer Tools window for the page, and it says that the page default is IE 8 standards mode, but still renders the page wrongly. However, changing the mode in developer tools to another mode and then switching back to IE 8 standards mode causes the page to render correctly.
Is there some other IE-specific incantation that I'm missing, or is this a known bug for IE 8 (or the IE Developer Tools)?
If it helps, here are the first few lines of the page (Sorry I don't have a link to the page, it's a proprietary product that is intended for deployment on intranets). I've checked that nothing comes before the DOCTYPE (though that apparently is no longer an issue for IE 8):
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<!-- to override ie compatibility mode for intranets: http://blogs.msdn.com/b/ie/archive/2009/02/16/just-the-facts-recap-of-compatibility-view.aspx -->
<meta http-equiv="X-UA-Compatible" content="IE=8" />

Either change your DOCTYPE to an XHTML one, or remove your self-closing tags.

I have encountered identical problem as Neil Ongkingco described. We've added a DOCTYPE, and the developer tool shows that the IE is rendering in IE8 Standard Mode. However, the webpage do not render as we expected. Changing the mode back and forth fixes the problem for that session, but it's not working as described. Here is what we've done to fix the problem.
We kept the DOCTYPE as below. I don't think it matters whether you have Loose or Strict mode.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
Added the X-UA-Compatible metatag as described. We left out the closing slash as shown below.
<meta http-equiv="X-UA-Compatible" content="IE=8">

Related

How run IE in edge mode without devtools?

I am currently running IE in edgemode but only when I use the devtools(F12). When I turn off the devtools it seems to be running in IE 7 mode. How can I change this without adjusting the registry? I am not an admin on this machine I am working on.
you can use Meta tag:
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<title>My Web Page</title>
</head>
<body>
<p>Content goes here.</p>
</body>
</html>
Either you can use Enterprise Mode Site List Manager
2.1 Use Enterprise Mode to improve compatibility
2.2 Fix web compatibility issues using document modes and the Enterprise Mode site list
Thanks :-)

Set Browser Mode to IE 8 automatically when html page gets loaded

My Application is compatible only with IE8.So, whenever we open the page,Broswer Mode should set automatically to IE 8,instead of going to developer tools and setting there
I always use
<meta http-equiv="x-ua-compatible" content="IE=EmulateIE8" >
this needs to get in the head tag.
You need to add a meta tag to your document head specifying IE8 compatibility mode.
<meta http-equiv="x-ua-compatible" content="IE=8" >

Document mode IE7 standards for IE8

My document looks like this:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<!--[if lte IE 8]>
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<![endif]-->
I'm using IE10 to test everything. When I switch Browser Mode to IE7 the Page Default Document Mode shows to be IE7 standards. However when I switch to IE8 Browser Mode the Page Default Document Mode is IE8 standards. Why doesn't the meta tag change it to IE7 standards? Is it something to do with my browser configuration? How can I make sure that everyone who look at my site from IE8 get the Document Mode of IE7 by default?
You're hiding the meta tag, so IE10 will never see it. You'll need to remove the conditional comment wrapping.
And then, I presume that when you put IE in IE8 browser mode, that action forces use of the IE8 renderer and thus it will ignore the X-UA-Compatible header.

IE Standards modes

I just have a quick question about IE8 Standards mode vs Quirks mode.
The page displays fine if you load its first page then log in. I have searched for the doc type which i think is right for changing the page to IE8 Standards Mode and i think it works because IE's built in debugger says it's in that mode. Also if you start on another page which uses quirks mode then navigate to my site the debugger changes modes to IE8 standards.
The problem starts if your change the mode to IE8 standards before you visit the page. e.g say your on google and change the mode in the debugger to IE8 standards then visit the site the page isn't displayed correctly.
I hope i've explained my problem clearly enough. I've posted the doctype i'm using is that is any help.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
Add this meta tag to the head
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
This will force IE into the latest standards mode. So if they have IE8 it will be in IE8 even if its set before to other mode.
Also you could start using the html doctype without problem
<!DOCTYPE html>
You can read more about it here:
The IE Blog has posted "How IE8 Determines Document Mode" which you should read. Also, note that MS introduced a (... ah! Geries beat me to the punch while typing this!) Take a look at Geries' comment. :)

IE8 doctype changing

I am currently using an XHTML 1.0 transitional doctype on my vBulletin website. The page in question is PHP. The source (view source) of this page verifies that the XHTML 1.0 transitional doctype is on the page. Upon downloading (File > Save As) the page in IE8, I realized that my doctype had been replaced with an HTML 4.0 transitional doctype.
Why does IE8 change the doctype?
Why isn't the doctype its chosen displayed in the "View Source"?
The answer lies in the global vBulletin options menu.
vBulletin Options -> Cookie and HTTP Header Options -> Send Internet Explorer 7 Compatibility Header (Yes/No)
Disabling that will prevent IE8 from rendering as IE7, and from using the 4.0 HTML transitional doctype.
Please check which Document Mode Your IE8 is running in. If it is IE8 then its some other error. If it's something else than IE8 please add this meta tag as the first element of the <head> Tag.
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />

Resources