Using the correct DOCTYPE

Below are the most commonly used doctypes. Note that using different doctypes may require a change in the media / mime type that is used to serve the document.
Here is a summary of the acceptable mime type to use.


Contents of this page


XHTML Doctypes

XHTML 1.1

Files with this doctype should be served with the application/xhtml+xml mime type.

XHTML 1.0 Strict

This is best served as the default text/html so the XML statement is not needed.

XHTML 1.0 Transitional

XHTML 1.0 Frameset

Frames are considered to be “not best practice” and so should be avoided. This doctype should only be used on the frameset page.


HTML Doctypes

HTML 4.01 Strict

HTML 4.01 Transitional

HTML 4.01 Frameset

Frames are considered to be “not best practice” and so should be avoided. This doctype should only be used on the frameset page.


Character set Meta tag

This one always gets me. Stick it the head element so the validators don’t complain.

Tags