DOCTYPE declaration

What is DOCTYPE declaration in HTML?

The necessity of DOCTYPE declaration in HTML :

The DOCTYPE declaration is used to inform the visitor’s web browser that the document being rendered is an HTML document. Every HTML document should be with a DOCTYPE declaration to be compliant with HTML standards. Without the DOCTYPE, we are forcing the browsers to render in Quirks Mode. DOCTYPE is partially used by the browsers to determining dialect and parsing. This is why HTML5 has reduced the DOCTYPE to simply.

A document type declaration, or DOCTYPE, is an instruction that associates a particular SGML or XML document (for example, a webpage) with a document type definition (DTD) (for example, the formal definition of a particular version of HTML1.0 – HTML 4.0). In the serialized form of the document, it manifests as a short string of markup that conforms to a particular syntax.

1. The DOCTYPE Declaration is not mandatory in HTML5
2. The DOCTYPE is not an HTML element or tag.
3. DOCTYPE gives an instruction to the web browser about the version of HTML we are using on our web page.
4. If we declare the DOCTYPE then it should be the first thing in our HTML document and we have to declare it before the <html> tag.
5. The <!DOCTYPE html> declaration is NOT case sensitive.

Different Version’s HTLM doctype declaration :

You may Found some another useful HTML related post here Blog.

No Comment

    Leave a Reply