In this article we are going to explain what is doctype in html or why use doctype in every HTML document with example.
The <!DOCTYPE html > declaration is used to inform a website visitor's browser that the document being rendered is an HTML document . This <!DOCTYPE html> declaration is not an HTML element , every HTML document should being with a DOCTYPE declaration to be compliant with HTML standards. This element must not contain any content, and does not need a closing tag.
Let's see an example of HTML document with doctype declaration.
<title>This is the title</title>
This is the content of the document.
I hope this article will help to you after reading.Let's check live example