11-18-2004, 12:37 PM
Leshy,Nov 16 2004, 01:29 PM Wrote:Not really. Just be sure to use the full DTD, including an URL referring to it's location to trigger standards mode in MSIE, Mozilla/Firefox and Opera, such as this one for XHTML 1.0:If you omit the DTD altogether, all browsers will switch to quirksmode, whereas I believe both Opera and Firefox have a so-called "Almost-Standards" mode which can be activated by using a DTD without the URL.
No. Most browsers use standards mode for most (not all) 'strict' doctypes, but use quirks mode for most (not all) 'transitional' doctypes.
Furthermore, the browsers do behave differently. For example, IE uses quirks mode for some doctypes where other browsers use standards mode (e.g. certain - perfectly valid! - XML doctypes). If you use a HTML 4.0 doctype, the behaviour of browsers also differs alot.
Also note that including a URL referring to a DTD is not necessary for a doctype declaration to be valid, and in some cases also not necessary to trigger standards mode. If Firefox finds a doctype without a URL, it will go into standards mode for *some* doctypes, but into almost standards or quirks mode for others. On the other hand, it is also not true that every valid doctype declaration with a URL will trigger standards mode in Firefox, and the behaviour of other browser differs from that again.
And so on, and so on... there are alot of inconsistencies. If you really want to trigger a specific a browser mode, you must inform yourself in detail about the behaviour of the browser in question, or just test it.
The very concept of doctype sniffing sucks, if you ask me... but I guess we have to live with it for the next few years...
Quote:Simply be sure to add a full Document Type Definition to your pages, ditch tables for anything besides presenting tabular data and all will be relatively well :)
[right][snapback]60301[/snapback][/right]
Unfortunately, there are still some situations where you have to use tables for your layout. CSS and the support for it is still far from being perfect, even in modern browsers :-/ One should try to avoid using tables for layout purposes whenever possible, though.