3

If I set the doctype to the HTML 5 <!DOCTYPE html>, this will set browsers into standards mode.

Does that mean that most modern browsers will behave as if they are in HTML 4.01 Transitional mode?

mauris
  • 42,982
  • 15
  • 99
  • 131
SStedman
  • 33
  • 3

3 Answers3

5

Browser's don't actually have a "HTML 4.01 Transitional mode". They have a "standards" mode and historic modes, "quirks" and "almost standards" for most browsers, and a variety of earlier IE behaviours for IE.

There isn't a direct mapping from a "HTML 4.01 Transitional" doctype to a mode, but for most modern browsers, it maps to "almost standards" mode in the presence of the SYSTEM identifier and "quirks" mode in its absence.

For more details, see http://hsivonen.iki.fi/doctype/ and http://dev.w3.org/html5/spec/tree-construction.html#the-initial-insertion-mode

Alohci
  • 78,296
  • 16
  • 112
  • 156
0

It means the browser will be in standards mode as opposed to quirks, which is the only real distinction to be made unless you're concerned about a specific kind of validation for some reason. Strict was only interesting in the context of making an html document adhere to xml standards, which HTML5 doesn't follow.

kinakuta
  • 9,029
  • 1
  • 39
  • 48
  • 2
    -1. A Transitional DTD doesn't necessarily cause quirks mode, and the Strict doctype has nothing to do with XML. – Alohci Jun 12 '11 at 09:40
  • You're right, strict doesn't reference only xhtml. Although I said nothing about transitional causing quirks mode. – kinakuta Jun 12 '11 at 09:44
  • ... and HTML5 supports the optional use of XML standards. – Alohci Jun 12 '11 at 09:45
  • HTML5 doesn't care about XML standards. You can use them and HTML5 doesn't care. – kinakuta Jun 12 '11 at 09:47
  • @user156629 - Maybe you didn't mean to say that transitional caused quirks mode, but if you read the question body and your first sentence up to the comma, it's easy to assume that implication. – Alohci Jun 12 '11 at 09:52
  • @user156629 - On XML standards in HTML5, agreed, yes you can. But you can also use XML standards if you so wish. Just use an XML content type (e.g. application/xhtml+xml) when serving your page. See http://dev.w3.org/html5/spec/the-xhtml-syntax.html#the-xhtml-syntax – Alohci Jun 12 '11 at 09:56
  • LOL, I didn't mean to say it, AND I didn't actually say it, which is why you shouldn't stop reading when you get to a comma. – kinakuta Jun 12 '11 at 09:58
  • Point taken about the XML content type. – kinakuta Jun 12 '11 at 10:00
0

No these are not similar. Though HTML 5 Doctype is still a draft. But if you will validate your code on HTML 5 compliance check, it will not support the deprecated html 4 attributes or tags. Also, the new HTML 5 tags will only be supported in HTML 5 doctype when you are validating your code. You can validate it at this link: http://validator.w3.org/

Varun Goel
  • 339
  • 3
  • 15