Before coding a program, you must understand that HTML contains rules: which explains what tags, attributes and values are valid for a particular HTML file. These rules are defined by Document Type Definition(DTD) file or simply the Doctype which is used above all HTML file.
You can use either HTML or XHTML doctype, depending upon your needs. You can understand much about this here.
HTML 4.01 Strict
This type of doctype allows only tags that are recent and doesn’t allow tags that are deprecated. These tags are not so common and should be used only to create a standard declaration
HTML 4.01 Transitional
A transitional doctype is the most common type and it allows the deprecated tags too to fill the code and that is of a great advantage and most developers use this kind of DTD to their webpage.
HTML 4.01 Frameset
This is same as the transitional doctype, but the only difference is that it allows additional frameset in a webpage.
XHTML 1.0 Strict
Similar to the HTML Strict DTD declaration, this one also doesn’t allow deprecated tags into the code.
XHTML 1.0 Transitional
This one has a slight modification than the Strict declaration by allowing the deprecated tags, so that coders can also choose the old tags.
XHTML 1.0 Frameset
This allows the deprecated tags and it is just similar to the transitional doctype declaration and with an additional feature of allowing frameset in a page.
It is very important to use doctype at the beginning of every HTML file, even though many modern browsers accept HTML without a doctype, as it may lead to future miseries.