Force Internet Explorer 9 into Quirks Mode - css

I have a web design class and our teacher wish's for us to force a browser into quirks mode.
Is their any CSS feature or html 5 feature that will do the job? Its for a discussion question but I need to make a simple webpage.

Don't provide a doctype, it will go into quirks mode on its own.
<html>
<head>
<title>I'm in Quirks Mode</title>
</head>
<body>
<p>Quirks mode supports the JavaScript functionality of
IE6, and the Quirks mode of IE7 and IE8.</p>
</body>
</html>
If you need something to cite:
If your webpage uses one or more features that require IE9 mode and you do not include a standards-compliant !DOCTYPE directive, Internet Explorer 9 displays, by default, your webpage in IE5 (Quirks) mode, which does not support features that require IE9 mode. source
Additionally you can force it into Quirks Mode via the developer tools as well; just press F12 and change the Document Mode. Note that this method is usually only used for quick testing, and affects your local copy only.

Adding any HTML comment block above your tag will throw IE9 into Quirks Mode!
Like this
<!-- -->
<!DOCTYPE html>
<html>
Source http://timjames.me/force-ie9-into-quirks-mode

try without doctype but it wont be a good idea
or try
<!-- -->
<!DOCTYPE html>

Related

Why is this CSS:before statement not working in IE 8, IE9?

Using a :before CSS to get an image/icon here (see round circle in image below), but in Internet explorer 8+ it is just not showing up.
This is the site:
http://www.websiteprofessioneel.nl
Image link below shows right element (it's the icon in the first post header) as circled on this screendump
http://tinypic.com/view.php?pic=xxd9f&s=5#.Ul_WajZRoWY
this is the CSS for that:
.welpen h2:before {
content: url("/wp-content/uploads/z-welpen-category-small.png") !important;
}
Anything missing perhaps? All other browsers work fine and as far as I know peudo CSS is totally supported in at least IE9, but it's not working in both IE8, 9 and up.
IE is Probably Using Quirks Mode
Internet Explorer can run in quirks or standards mode. The purpose of quirks mode was to make the new standards-compliant IEs (8+) able to read and process the code people had previously written for IE7-.
Likely Reason #1: invalid or absent DOCTYPE declaration
Try specifying this on the first line of your HTML document:
<!DOCTYPE html>
Make sure the <html> element is present. Even though HTML5 specification says it's not needed, older IEs (10 and older) tend to enter quirks mode when it's not specified.
Likely reason #2: site fails (X)HTML validation
If this is present, make sure the W3C validator throws no errors as these can also trigger Quirks Mode in IE. Yours has 15.
Actual reason was more unlikely: deliberately triggering Quirks Mode
After comments discussion, turns out I was right about the quirks mode, but wrong about the reason. Make sure you don't have any meta tags telling IE to run in quirks mode such as this:
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
problem is because of something wrong in doctype, use <!DOCTYPE html> for html5 and to make it working on ie8 use
<!--[if IE]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
if you don't want html5 then use
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
this will fix the problem i think

Request.Browser always registers as IE7 even when running IE8 or IE9

I am using the following asp.net code to detect the browser type:
System.Web.HttpBrowserCapabilities browser = Request.Browser;
if (browser.Browser == "IE" && browser.MajorVersion == 7)
{
do stuff...
}
I am running IE9, but when I debug, the browser.MajorVersion is always 7. What could cause this and how can I prevent it?
Make sure that you have browser mode set to IE9 in developer tools
This is what MS says about doctypes source link
If a webpage specifies a doctype directive and includes an X-UA-Compatible header, the header takes precedence over the directive.
If the browser supports the header, but not any of the specified document modes, it will use the highest supported document mode to display the webpage.
Older versions of the browser that don't support the header use the to determine the document mode.
Internet Explorer 9 and earlier versions display webpages without directives in IE5 (Quirks) mode. As a result, we recommend all webpages specify a directive, such as the HTML5 doctype.
This flexibility allows the greatest compatibility for earlier versions of Internet Explorer that remain popular.
Note Because all supported versions of Internet Explorer (including Microsoft Internet Explorer 6) interpret the HTML5 document type as a standards mode document type, we recommend using the HTML5 document type for all webpages that don't require a different declaration. This ensures that your webpages are display in the highest available standards mode.
The X-UA-Compatible header isn't case sensitive; however, it must appear in the header of the webpage (the HEAD section) before all other elements except for the title element and other meta elements.
You need to specify a specific document mode for your webpage, use the meta element to include an X-UA-Compatible header in your webpage, as shown in the following example.
<html>
<head>
<!-- Enable IE9 Standards mode -->
<meta http-equiv="X-UA-Compatible" content="IE=9" >
<title>My webpage</title>
</head>
<body>
<!-- Your Content -->
</body>
</html>

How to change Document Mode from Quirks Mode to Standard Mode in Internet Explorer 7?

Current I having problem on using CSS position:fixed in my IE 7,
Noticed it is fine after I changed the Document Mode from Quirks Mode to Standard Mode (try switching in IE8 Developer Toolbar).
Is there any workaround on this? perhaps there is an option on IE setting.
Is IE 7 by default is not render the page in Quirks Mode? or it is determine by the page's DocType?
Appreciate any help, thank you in advanced.
To put the browser in standards mode you need to set a valid doctype and it must be the first thing in your document. Without one and if there is something, even a comment, before it then Internet Explorer will trigger quirks mode.
The simplest one to use is the one for HTML5:
<!DOCTYPE HTML>
However you could also use something like this one for HTML4.01 Transitional:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
Or you can refer to this list for others: http://www.w3.org/QA/2002/04/valid-dtd-list.html

Web Server tomcat is not loading the ie related css

I have an issue with css.
I have a css file which has ie specific css clauses..Like
.ie7 #div
.ie #table
These css is working good in my local on tomcat server.
But the same css is not loading in IE in my dev system which is also running on tomcat.
When I debug the ie is not recognizing the ie specific css clauses. Also I found out that
the IE is not recognizing even the section and header tags.
Please let me know what can be the work around.
Thanks for your time and help.
Regards,
Varma
Assuming you're running IE9..
Make sure you don't have Compatibility Mode turned on, and make sure you have a valid doctype as the very first line to trigger Standards Mode:
<!DOCTYPE html>
If it still doesn't work, then add this meta tag:
<meta http-equiv="X-UA-Compatible" content="IE=edge">
Concerning this point:
Also I found out that the IE is not recognizing even the section and
header tags.
In older versions of IE, you need this to make the HTML5 semantic tags work properly:
http://code.google.com/p/html5shiv/

ie 8 show itself as ie7 [CSS if condtion]?

ie8 version on my computer , show itself as ie 7 when i use CSS IE CONDTION like
<!--[if IE 7]>
<script type="text/javascript">alert('hello iam ie 7 :P ');</script>
<![endif]-->
but when i try it on another computer with ie8 its work normally , its possible to have any
problem in my client website or this is ie problem ?
(IE 8.0.7600.16385 )
It may be problem with ur Internet Explorer Developer Tool so, use following to solve it,
press F12,
you can see the Browser Mode : IE8,
change it by clicking on it,
and select the appropriate menu,
Internet Explorer 7
Msie8 has an option to act as ie7 -- if you press F12 you will get a debug window, and in the upper right corner of that window you should see various options about which version to act as. You can switch to ie8 there.
can't tell for sure but I had an problem with ie8 some time ago that sounds pretty related to yours...
In my case I had to set the doctype of the html element in order to not run in compatibility mode where ie8 acts like it was ie7...
Just add something like that on the first line of your html and see if it works...
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">

Resources