What Is Doctype In HTML: The Document Type Declaration
The HTML Doctype is the first line of code in every HTML document. The doctype provides information to the browser on which HTML versions are used to design the document. So don’t forget to declare the doctype.
The Doctype declaration stands for document type declaration. It places before the root element. If you forget to mention it, browsers will run your document in Quirks mode.
HTML5 Doctype
The doctype declaration in HTML 5 is very easy and simple. It does not require any DTD. And it is not cased sensitive.
Doctype Declaration in XHTML
The HTML doctype declaration in XHTML is is very lengthy. Its require a Document Type Defination (DTD)
Three possible types of Declaration in XHTML.
- Strict
- Transitional
- Frameset
Strict Type Declaration
Strict type declaration supports all tags and elements expected deprecated elements.
Frameset Type Declaration
The frameset type declaration supports all deprecated elements including frames.
Transitional Type Declaration
The transitional type declaration supports all deprecated elements but does not support frames.