What is a DocType?

A DocType tells your browser what type of document the file is as well as how to render the web page.

HTML stands for HyperText Markup Language.

There are a few different versions of DocTypes such as:

html 5 logo

HTML 5. This is the most recent DocType that was established on October 28, 2014 by W3C (World Wide Web Consortium) recommendations.
However, Web Hypertext Application Technology Working Group (WHATWG), continues to work on HTML5 consistently evolving the platform.
For HTML5 doctype declaration, you must write <!DOCTYPE html> at the top of every file (which is not case sensitive).

XHTML. XHTML stands for Extensible Markup Language which was developed in 2000 by W3C. This platform was created to transition from
HTML to XML. There are three types of document type definitions (DTDs):

  1. Strict
  2. Transitional
  3. Frameset

XHTML Strict is used when Cascade Style Sheet (CSS) is used while XHTML Transitional is used for CSS but with attributes.

The filename extensions for XHTML can be:

HTML4.1. Similar to XHTML, there are 3 types of document type definitions (DTDs):

  1. Strict
  2. Transitional
  3. Frameset

The main difference between strict and transitional is framesets.

Framesets were a way of displaying two or more pages at once. Of course, there alwasy is HTML 4.1 Frameset which allows frames.

HTML Strict allows all the elements and attributes and it allows frameset, whereas HTML Transitional does not allow it.

You can check out this video for more information:

<