DTD is a set of syntax rules about tags. It is part of the XML version 1.0 specification, it is a verification mechanism for html files, and it is part of the html files.
DTD: Three document types: S (Strict), T (Transitional), F (Frameset).
Strict: If you need clean markings to avoid confusion in presentation layers, use this type. Please use it with Cascading Style Sheet (CSS)
Transitional: DTD can contain rendering attributes and elements that W3C wants to move into the style sheet. If your readers use browsers that do not support cascading stylesheets (CSS) so that you have to use HTML's rendering feature
Frameset: DTD should be used for documents with frames. Except for the frameset element that replaces the body element, Frameset DTD is equivalent to Transitional DTD
html5 basically does not have the strict requirements of XHTML 1.0 Transitional and simplifies a lot of things that can be used directly <!DOCTYPE HTML>
HTML5
<!DOCTYPE HTML>
--------------------------------------------------------------------------------------------------------------------------------
xhtml 1.1:
<!doctype html public -/w3c/dtd xhtml 1.1/en http://www.w3.org/tr/xhtml11/dtd/xhtml11.dtd>
xhtml 1.1 plus mathml plus svg:
<!doctype html public -/w3c/dtd xhtml 1.1 plus mathml 2.0 plus svg 1.1/en http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg.dtd>
--------------------------------------------------------------------------------------------------------------------------------
html 4.01 strict:
<!doctype html public -/w3c/dtd html 4.01/en http://www.w3.org/tr/html4/strict.dtd>
html 4.01 transitional:
<!doctype html public -/w3c/dtd html 4.01 transitional/en http://www.w3.org/tr/html4/loose.dtd>
html 4.01 frameset:
<!doctype html public -/w3c/dtd html 4.01 frameset/en http://www.w3.org/tr/html4/frameset.dtd>
--------------------------------------------------------------------------------------------------------------------------------
xhtml 1.0 strict:
<!doctype html public -/w3c/dtd xhtml 1.0 strict/en http://www.w3.org/tr/xhtml1/dtd/xhtml1-strict.dtd>
xhtml 1.0 transitional:
<!doctype html public -/w3c/dtd xhtml 1.0 transitional/en http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd>
xhtml 1.0 frameset:
<!doctype html public -/w3c/dtd xhtml 1.0 frameset/en http://www.w3.org/tr/xhtml1/dtd/xhtml1-frameset.dtd>
--------------------------------------------------------------------------------------------------------------------------------
html 3.2:
<!doctype html public -/w3c/dtd html 3.2 final/en>
--------------------------------------------------------------------------------------------------------------------------------
html 2 (number 2 represents version number):
<!doctype html public -/ietf/dtd html 2.0/en>
Attached an old version of the label to compare DTD document:
Label | describe | DTD |
<!DOCTYPE> | Define the document type. | STF |
<html> | Define HTML documents. | STF |
<body> | Defines the body of the document. | STF |
<h1> to <h6> | Define HTML title. | STF |
<p> | Define paragraphs. | STF |
<br> | Define simple folding. | STF |
<hr> | Define the horizontal line. | STF |
<!--...--> | Define comments. | STF |
Label | describe | DTD |
<b> | Define bold text. | STF |
<font> | Not favored. Define the font, size, and color of the text | TF |
<i> | Define italic text. | STF |
<em> | Definition emphasizes text. | STF |
<big> | Define large text. | STF |
<strong> | Define the tone to emphasize the text more strongly. | STF |
<small> | Define trumpet text. | STF |
<sup> | Define superscript text. | STF |
<sub> | Define subscript text. | STF |
<bdo> | Define the direction of the text. | STF |
<u> | Not favored. Define underlined text. | TF |
Label | describe | DTD |
<pre> | Define preformatted text | STF |
<code> | Define computer code text. | STF |
<tt> | Define typewriter text. | STF |
<kbd> | Define keyboard text. | STF |
<var> | Defines the variable part of the text. | STF |
<dfn> | Definition defines the project. | STF |
<samp> | Define computer code samples. | STF |
<xmp> | Not favored. Define preformatted text. |
Label | describe | DTD |
<acronym> | Definition takes only the abbreviation of the first letter. | STF |
<abbr> | Define the abbreviation. | STF |
<address> | Defines the contact information of the document author or owner. | STF |
<blockquote> | Defines block references. | STF |
<center> | Not favored. Define the centered text. | TF |
<q> | Define short references. | STF |
<cite> | Define a reference (citation). | STF |
<ins> | Definitions are inserted into text. | STF |
<del> | Defines the deleted text. | STF |
<s> | Not favored. Defines text with strikethrough. | TF |
<strike> | Not favored. Defines text with strikethrough. | TF |
Label | describe | DTD |
<a> | Define the anchor. | STF |
<link> | Defines the relationship between a document and an external resource. | STF |
Label | describe | DTD |
<frame> | A window or framework that defines a frame set. | F |
<frameset> | Define the frameset. | F |
<noframes> | Defines alternative content for users who do not support the framework. | TF |
<iframe> | Define an inline framework. | TF |
Label | describe | DTD |
<form> | Defines an HTML form for user input. | STF |
<input> | Define the input control. | STF |
<textarea> | Defines multiple lines of text input control. | STF |
<button> | Define button. | STF |
<select> | Define the selection list (drop-down list). | STF |
<optgroup> | Defines the combination of relevant options in the selection list. | STF |
<option> | Define the options in the selection list. | STF |
<label> | Defines the annotation of the input element. | STF |
<fieldset> | Defines the border around elements in the form. | STF |
<legend> | Defines the title of the fieldset element. | STF |
<isindex> | Not favored. Defines searchable indexes related to the document. | TF |
Label | describe | DTD |
<ul> | Define an unordered list. | STF |
<ol> | Define an ordered list. | STF |
<li> | Define the item that lists. | STF |
<dir> | Not favored. Define a directory list. | TF |
<dl> | Definition definition list. | STF |
<dt> | Defines the items in the definition list. | STF |
<dd> | Define the description of the item in the definition list. | STF |
<menu> | Not favored. Define menu list. | TF |
Label | describe | DTD |
<img> | Define the image. | STF |
<map> | Define image mapping. | STF |
<area> | Defines the area inside the image map. | STF |
Label | describe | DTD |
<table> | Define the table | STF |
<caption> | Define the table title. | STF |
<th> | Defines the header cell in the table. | STF |
<tr> | Defines the rows in the table. | STF |
<td> | Defines the cells in the table. | STF |
<head> | Defines the contents of the header in the table. | STF |
<tbody> | Defines the main content in the table. | STF |
<tfoot> | Define the table notes (footnotes) in the table. | STF |
<col> | Defines the attribute value of one or more columns in a table. | STF |
<colgroup> | Defines the column group in the table for formatting. | STF |
Label | describe | DTD |
<style> | Defines the style information of the document. | STF |
<div> | Defines sections in the document. | STF |
<span> | Defines sections in the document. | STF |
Label | describe | DTD |
<head> | Define information about the document. | STF |
<title> | Defines the title of the document. | STF |
<meta> | Define meta information about HTML documents. | STF |
<base> | Defines the default address or default destination for all links in the page. | STF |
<basefont> | Not favored. Defines the default font, color, or size of text in the page. | TF |
Label | describe | DTD |
<script> | Define client scripts. | STF |
<noscript> | Defines alternative content for users who do not support client scripts. | STF |
<applet> | Not favored. Defines embedded applets. | TF |
<object> | Defines the embedded object. | STF |
<param> | Defines the parameters of the object. | STF |