Whenever you create an HTML document, the doctype is the first thing placed in the document.
It conveys the web browser about the version of the HTML, this page is written on. It is not casesensitive.
Let us see an example displaying DOCTYPE on the top −
<!DOCTYPE html> <html> <head> <title>Document Title comes here</title> </head> <body> <h1> Demo Heading </h1> This is the demo text. </body> </html>
Now let us see some of the declarations for doctype −
This document type includes all HTML elements except those that have been deprecated, and those that appear in frameset documents.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
This document type includes all HTML elements including those that have been deprecated −
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">;