Search code examples
htmldoctypetransitional

Is html 5 <!DOCTYPE html> equivalent to html 4 transitional doctype?


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?


Solution

  • 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