sams5817
sams5817

Reputation: 1037

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.

Upvotes: 1

Views: 9854

Answers (1)

tw16
tw16

Reputation: 29605

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

Upvotes: 5

Related Questions