html tutorial - <!Doctype> Declaration in HTML - html5 - html code - html form

doctype in html

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 :

<!Doctype html>

Difference between HTML 4.01 and HTML5:

HTML 4.01

  • 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:

<!DOCTYPE html>
        <title> Wikitechy </title>
        <h3>Welcome to Wikitechy</h3>
        <p>Students Learning Portal</p>

Code Explanation for <!Doctype> declaration:

Code Explanation for <!Doctype>

  1. < !Doctype html >-defines the version of the HTML document.

Browser Support for <!Doctype>declaration:

Yes Yes Yes Yes Yes

Tips and Notes

  • The <!DOCTYPE> declaration is not case sensitive.
  • To check the HTML Web documents is valid, go to W3C validation service.

Related Searches to Html Doctype