HTML <!DOCTYPE> Tag: The DOCTYPE is not a HTML tag.It is an instruction to the web browser in which version the HTML page is written. DTD (document type definition) specifies the rules of markup language because the browser renders the content correctly. And the <!Doctype> is declare in HTML document before <html> tag.
HTML <!DOCTYPE> Tag
HTML !DOCTYPE is the first thing in every HTML document.It is written befor the <html> tag. There are three type <! Doctype> declarations in HTML4. And in HTML5 there is only one declaration. It does not refer DTD.
Syntax: <!Doctype html>
Browser compatibility
The DOCTYPE is supported by different types of browsers. They are as follows:
- Chrome
- Opera
- Safari
- Firefox
- Internet Explorer.
Syntax: <!DOCTYPE html>
Example:
<!DOCTYPE html> <html> <body> Welcome to Freshersnow Tutorial </body> </html>
Output:
Welcome to Freshernow Tutorial