what is <!DOCTYPE html> in HTML ?

Nirbhay Singh
1 min readJan 20, 2023

In HTML, the <!DOCTYPE> declaration is used to indicate the type of document and the version of HTML being used. The <!DOCTYPE> declaration is the first line of an HTML document and should always be included, as it tells the browser which version of HTML or XHTML the document is written in.

The <!DOCTYPE html> is the new HTML5 doctype and it is used to tell the browser that the document is written in HTML5. This is the simplest and most up-to-date doctype. It is compatible with all HTML5-compliant browsers, and it is a shorter and easier to remember than other doctype declarations.

It is important to use the correct doctype because it affects how the browser renders the page. If the doctype is not specified, or if it is specified incorrectly, the browser may not display the page correctly.

It is also important to note that the <!DOCTYPE> declaration is case-insensitive, but it is recommended to use uppercase letters.

--

--

Nirbhay Singh

Technophile, DevOps Consultant at Deloitte, talks about DevOps, Cloud, Site Reliability Engineer, Linux and Programming.