DOCTYPE in HTML/ XHTML documents and rendering modes

Acceptable standard doctypes to use for a text/html document as well as the browser rendering modes are shown here:

HTML version

DTD type

Examples

Modern

non-IE (1)

IE9/ IE8/

Opera 9.5

IE7/

Opera 7.1

IE6/

Opera 7.0

HTML 5

N.A.

<!DOCTYPE html>

S

S

A

A

HTML 4.01

Strict

<!DOCTYPE HTML PUBLIC

"-//W3C//DTD HTML 4.01//EN">

or with URL

"http://www.w3.org/TR/html4/strict.dtd"

S

S

A

A

Transitional

<!DOCTYPE HTML PUBLIC

"-//W3C//DTD HTML 4.0 Transitional//EN">

Q

Q

Q

Q

Transitional (with URL)

As above with either URLs

"http://www.w3.org/TR/html4/loose.dtd"

or

"http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd"

A

A

A

A

HTML 4.0

Strict

<!DOCTYPE HTML PUBLIC

"-//W3C//DTD HTML 4.0//EN">

S

S

A

A

Transitional

<!DOCTYPE HTML PUBLIC

"-//W3C//DTD HTML 4.0 Transitional//EN">

Q

Q

Q

Q

Transitional (with URL)

As above with either URLs

"http://www.w3.org/TR/html4/strict.dtd"

or

"http://www.w3.org/TR/html4/loose.dtd"

Q

A

A

A

XHTML 1.1

Strict

<!DOCTYPE html PUBLIC

"-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

S

S

A

A (2)

XHTML 1.0

Strict

<!DOCTYPE html PUBLIC

"-//W3C//DTD XHTML Basic 1.0//EN" "http://www.w3.org/TR/xhtml-basic/xhtml-basic10.dtd">

or

<!DOCTYPE html PUBLIC

"-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

S

S

A

A (2)

Transitional

<!DOCTYPE html PUBLIC

"-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

A

A

A

A (2)

Legend:

  • S denotes standards mode (no quirks mode) – should always be used.
  • A denotes Almost standards mode (limited quirks mode) – use this mode instead of standards mode if tables are used to layout (sliced) images.
  • Q denotes Quirks mode (or IE 5.5 mode) – should no longer be used (except for backward compatibility).

Footnotes:

  1. Modern non-IE browsers include Mozilla 1.0.1/ Firefox/ Safari 0.9/ Chrome/ NS7/ Opera10/ Konq3.5/ HTML5 browsers
  2. Bug in IE6 will cause rendering to be in Quirk mode if standard XML declaration (<?xml version="1.0" encoding="UTF-8"?>) is found.

A good source of information can be found here

Comments

Popular posts from this blog

Understanding ITIL Service Management the UML way…

How to depict (Professional-Looking) Logical Network Diagrams in Astah