Quick Answer
What is an HTML DOCTYPE?
The DOCTYPE declaration tells browsers which HTML version you're using. HTML5 uses the simple <!DOCTYPE html> declaration at the start of your document. Older versions like HTML 4.01 and XHTML required longer DOCTYPE declarations. Always include a DOCTYPE to ensure browsers render your page in standards mode.
HTML5 (Recommended)
The HTML5 doctype is simple, short, and case-insensitive. It is the recommended doctype for all modern HTML documents. This declaration tells the browser to render the page in standards mode.
Features:
- Simple and easy to remember
- Case-insensitive
- Triggers standards mode in all browsers
- Supports all HTML5 features
HTML 4.01
This DTD contains all HTML elements and attributes, but does NOT include presentational or deprecated elements (like font). Framesets are not allowed.
This DTD contains all HTML elements and attributes, INCLUDING presentational and deprecated elements (like font). Framesets are not allowed.
This DTD is equal to HTML 4.01 Transitional, but allows the use of frameset content.
XHTML 1.0
This DTD contains all HTML elements and attributes, but does NOT include presentational or deprecated elements (like font). Framesets are not allowed. Markup must be written as well-formed XML.
This DTD contains all HTML elements and attributes, INCLUDING presentational and deprecated elements (like font). Framesets are not allowed. Markup must be written as well-formed XML.
This DTD is equal to XHTML 1.0 Transitional, but allows the use of frameset content.
XHTML 1.1
This DTD is equal to XHTML 1.0 Strict, but allows you to add modules (for example to provide ruby support for East-Asian languages).
HTML Free Codes