Forum Moderators: open
I gather that a transitional document type declaration puts most browsers in "Quirks" mode.
So you might as well not use a DTD at all. (Is this correct?)
What I don't get is this:
"HTML 4.01 Transitional document type declaration with the URL [w3.org...] ie. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">"
makes most browsers use "Standards" mode.
Heh? I thought the point of a transitional DTD was so that browsers would "gloss over" non-standard coding.
PS: The nick: was on the verge of trying "AllTheGoodNamesHaveBeenTaken" so don't laugh. ;)
And guessing about what doctypes do to the browser can lead to real trouble.
the straight scoop on doctypes in IE is located at:
[msdn.microsoft.com...]
I gather that a transitional document type declaration puts most browsers in "Quirks" mode. So you might as well not use a DTD at all. (Is this correct?)
Transitional is still a standard. It is intended as a half way house between an old standard and a newer one. So html 4.01 transitional will allow you to use all the advances added in 4.01 while at the same time not removing some of the older html 3.2 tags. The code must still be vallid.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
Outside of that, the browser will render based on the referenced DTD...
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
Transitional is more of a compromise and allows you to use html elements that cannot be used in Strict. Elements such as target="".
Both of the declarations in the following example specify conformance to the Transitional HTML4.0 DTD. The second declaration specifies the URL of the DTD. The first declaration does not. The second declaration switches on standards-compliant mode with Internet Explorer 6 or later. The first declaration does not.
I wonder why they are declaring IE6 or later. Shouldn't that be IE3 or later?
Here is the standard as I understand it directly from the authoritative source, the W3C...
7.2 HTML version information [w3.org]
This element is available in HTML as of Internet Explorer 3.0.You can use this declaration to switch Internet Explorer 6 and later into strict standards-compliant mode. You turn the switch on by including the!DOCTYPE declaration at the top of your document, specifying a valid Label in the declaration, and in some cases, specifying the Definition and/or URL.
I take this to mean that prior to ie6 Internet Explorer was deliberately unable to display to w3c standards and that it is only an "option" now.
Note In standards-compliant mode, compatibility with other versions of Internet Explorer is not guaranteed. When standards-compliant mode is switched on, the rendering behavior of documents may be different in future versions of Internet Explorer.
I do believe this says web sites optimised for older versions of IE are by nature not compliant with web standards because of IE proprietary "enhancements"!
Perhaps Microsoft is going to rejoin the world?
Perhaps I'm dreaming?!
Guess what -
MOZILLA and Opera also use doctype switching in a similar manner. Quirks mode vs compliant mode. In the case of Mozilla there's even a third level - an "almost standards" mode. I don't have the URL's handy but the documentation is easy to find.
All of this has to do with having a way to tip the browser off about how the page is to be rendered. It's a backward compatibility thing.