Last Updated on May 11, 2023 by Roshan Parihar
HTML doctype tag is used to specify the type of the document. This tag must include the before <html> tag to show document type declaration.
1 2 3 4 5 6 7 8 9 |
<!DOCTYPE html> <html> <head> <title>This is document title</title> </head> <body> This is the document content. </body> </html> |
Output
The <!DOCTYPE>
tag does not contain any content and does not have any closing tag. The HTML doctype declaration confirms to the browsers that the document should be rendered as HTML.
The syntax of the HTML !DOCTYPE tag in HTML 5 is given below:
The above syntax shows that is HTML 5 document and should be executed as HTML. It has no closing tag in the HTML document. HTML 5 document declaration is standard and simple with this tag.
Specifications of HTML <!DOCTYPE> Tag:
Start Tag | <!DOCTYPE> |
---|---|
End Tag | N/A |
Content | N/A |
Supported Browsers
- Google Chrome
- Microsoft Edge
- Internet Explorer
- Safari
- Firefox
- Opera