html tutorial - <!Doctype> Declaration in HTML - html5 - html code - html form
Learn html - html tutorial - doctype in html - html examples - html programs
- The <!Doctype> is declare in HTML document before <html> tag.
- <!Doctype> is not a HTML tag.It is an instruction to the browsers about what version of HTML page.
- DTD (document type definition) specifies the rules of markup language, because the browser render the content correctly.
- Hence HTML5 is not based on SGML, it does not require a reference to DTD.
Syntax for <!Doctype> declaration :
Difference between HTML 4.01 and HTML5:
- There are three type <! Doctype> declaration in HTML4
- <! Doctype> refers DTD.
- There is only one declaration in HTML5.
- It does not refer DTD.
Sample coding for <!Doctype> declaration:
Code Explanation for <!Doctype> declaration:
- < !Doctype html >-defines the version of the HTML document.
Browser Support for <!Doctype>declaration:
Tips and Notes
- The <!DOCTYPE> declaration is not case sensitive.
- To check the HTML Web documents is valid, go to W3C validation service.