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.


<!DOCTYPE html>

Let's see an example of HTML document with doctype declaration.


<!DOCTYPE html>
    <title>This is the title</title>
    This is the content of the document.



 what is a doctype in html

I hope this article will help to you after reading.

 Let's check live example

Leave a comment

Make sure you enter the (*) required information where indicated. HTML code is not allowed.

You may also like