Menu

DOCTYPE in HTML

  • The DOCTYPE declaration is the first thing in your HTML document and it will be used before the HTML tag.
  • The DOCTYPE declaration is not an HTML tag.
  • <!DOCTYPE> declaration is not a HTML tag.
  • <!DOCTYPE> tells or instruct the web browser that what html version is using.
  • It must be the first thing on the web page before the tag HTML is writing.
  • The browser will understand what type of HTML document you are using if you add DOCTYPE to the web page. 
  • It just lets the browser know that the document type is HTML5. It defines that the document is in HTML 5 not and ordinary HTML5.
  • The DOCTYPE Declaration is not case sensitive.
  • The DOCTYPE declaration for HTML5 is simplified.
             <!DOCTYPE HTML>

Browsers Support for DOCTYPE

  • Google Chrome
  • Mozilla
  • Opera
  • Safari
  • Internet Explorer/Edge

HTML 4.1 had three types of DOCTYPEs

  1.  Strict
  2. Transitional
  3. Frameset