Introduction:

In this article we are going to explain what is doctype in html or why use doctype in every HTML document with example.

Description:

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.

syntax:

<!DOCTYPE html>


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

 

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

 

Output:

 what is a doctype in html

I hope this article will help to you after reading.

0 comments


Leave a comment

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

you may also like