Summary of DTD usage in HTML

Summary of DTD usage in HTML
DTD is a set of grammatical rules for markup. It is part of the XML 1.0 specification, is the validation mechanism for HTML files, and is part of the composition of HTML files.

DTD: Three document types: S (Strict), T (Transitional), and F (Frameset).
Strict: Use this type if you need clean markup, free from clutter in the presentation layer. Please use with Cascading Style Sheets (CSS)
Transitional: DTDs can contain presentation attributes and elements that the W3C expects to be moved into style sheets. Use this if your readers use browsers that do not support Cascading Style Sheets (CSS) and you are forced to use the presentation features of HTML.
Frameset: DTD should be used for documents with frames. The Frameset DTD is identical to the Transitional DTD, except that the frameset element replaces the body element.

HTML5 basically does not have the strict requirements of XHTML 1.0 Transitional, and simplifies many things so that you can use <!DOCTYPE HTML> directly.

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 (the number 2 represents the version number):
<!doctype html public "-/ietf/dtd html 2.0/en">

Attached is an old version of the tag comparison DTD document:

Label

describe

DTD

<!DOCTYPE>

Defines the document type.

STF

<html>

Defines an HTML document.

STF

<body>

Defines the body of the document.

STF

<h1> to <h6>

Defines the HTML title.

STF

<p>

Defines a paragraph.

STF

<br>

Defines a simple line break.

STF

<hr>

Defines the horizontal line.

STF

<!--...-->

Defines a comment.

STF

Label

describe

DTD

<b>

Defines bold text.

STF

<font>

Deprecated. Define the font, size and color of the text

TF

<i>

Defines italic text.

STF

<em>

Defines emphasized text.

STF

<big>

Defines large text.

STF

<strong>

Defines text with a stronger tone of voice.

STF

<small>

Defines small text.

STF

<sup>

Defines superscript text.

STF

<sub>

Defines subscript text.

STF

<bdo>

Defines the direction of the text.

STF

<u>

Deprecated. Defines underlined text.

TF

Label

describe

DTD

<pre>

Defining preformatted text

STF

<code>

Defines computer code text.

STF

<tt>

Defines typewriter text.

STF

<kbd>

Defines the keyboard text.

STF

<var>

Defines the variable part of the text.

STF

<dfn>

Definitions Defines the project.

STF

<samp>

Defines a computer code sample.

STF

<xmp>

Deprecated. Defines preformatted text.

Label

describe

DTD

<acronym>

Define an abbreviation using only the first letters.

STF

<abbr>

Define abbreviations.

STF

<address>

Defines the contact information for the document's author or owner.

STF

<blockquote>

Defines a block quote.

STF

<center>

Deprecated. Defines centered text.

TF

<q>

Defines a short quote.

STF

<cite>

Define citation.

STF

<ins>

Definition is inserted into the text.

STF

<del>

Defines the text to be deleted.

STF

<s>

Deprecated. Defines strikethrough text.

TF

<strike>

Deprecated. Defines strikethrough text.

TF

Label

describe

DTD

<a>

Define the anchor.

STF

<link>

Defines the relationship between the document and external resources.

STF

Label

describe

DTD

<frame>

Defines the window or frame of a frameset.

F

<frameset>

Defines a frameset.

F

<noframes>

Defines alternative content for users who don't support frames.

TF

<iframe>

Defines an inline frame.

TF

Label

describe

DTD

<form>

Defines an HTML form for user input.

STF

<input>

Defines an input control.

STF

<textarea>

Defines a multi-line text input control.

STF

<button>

Defines a button.

STF

<select>

Defines a selection list (drop-down list).

STF

<optgroup>

Defines a group of related options in a select list.

STF

<option>

Defines the options in a select list.

STF

<label>

Defines the annotation for an input element.

STF

<fieldset>

Defines a border around elements in a form.

STF

<legend>

Defines the title of the fieldset element.

STF

<isindex>

Deprecated. Defines a searchable index associated with a document.

TF

Label

describe

DTD

<ul>

Defines an unordered list.

STF

<ol>

Defines an ordered list.

STF

<li>

Defines the items of a list.

STF

<dir>

Deprecated. Defines a directory listing.

TF

<dl>

Defines a list of definitions.

STF

<dt>

Defines an item in a definition list.

STF

<dd>

Definition defines a description for an item in a list.

STF

<menu>

Deprecated. Defines a menu list.

TF

Label

describe

DTD

<img>

Defines an image.

STF

<map>

Defines an image map.

STF

<area>

Defines the area inside the image map.

STF

Label

describe

DTD

<table>

Defining a table

STF

<caption>

Defines the table title.

STF

<th>

Defines the header cells in a table.

STF

<tr>

Defines a row in a table.

STF

<td>

Defines the cells in the table.

STF

<thead>

Defines the header content in the table.

STF

<tbody>

Defines the main content of the table.

STF

<tfoot>

Defines the content of table notes (footnotes) in the table.

STF

<col>

Defines the property values ​​for one or more columns in a table.

STF

<colgroup>

Defines a group of columns in a table for formatting.

STF

Label

describe

DTD

<style>

Defines the style information for the document.

STF

<div>

Defines a section in a document.

STF

<span>

Defines a section in a document.

STF

Label

describe

DTD

<head>

Defines information about the document.

STF

<title>

Defines the title of the document.

STF

<meta>

Defines meta information about an HTML document.

STF

<base>

Defines the default address or default target for all links in the page.

STF

<basefont>

Deprecated. Define the default font, color, or size for text on a page.

TF

Label

describe

DTD

<script>

Defines the client script.

STF

<noscript>

Defines alternative content for users who do not support client script.

STF

<applet>

Deprecated. Defines the embedded applet.

TF

<object>

Defines an embedded object.

STF

<param>

Defines the parameters of an object.

STF

<<:  CSS draw a lollipop example code

>>:  The most detailed installation and configuration of redis in docker (with pictures and text)

Recommend

Echarts implements switching different X-axes in one graph (example code)

Rendering If you want to achieve the effect shown...

JavaScript implements the detailed process of stack structure

Table of contents 1. Understanding the stack stru...

Comparison between Redis and Memcache and how to choose

I've been using redis recently and I find it ...

Use of nginx custom variables and built-in predefined variables

Overview Nginx can use variables to simplify conf...

A practical record of restoring a MySQL Slave library

Description of the situation: Today, I logged int...

TimePicker in element disables part of the time (disabled to minutes)

The project requirements are: select date and tim...

Detailed explanation of Nginx configuration file

The main configuration file of Nginx is nginx.con...

Tutorial on installing Ubuntu 20.04 and NVIDIA drivers

Install Ubuntu 20.04 Install NVIDIA drivers Confi...

jQuery implements all selection and reverse selection operation case

This article shares the specific code of jQuery t...

The implementation process of long pressing to identify QR code in WeChat applet

Preface We all know that the QR codes in official...

JavaScript Advanced Custom Exception

Table of contents 1. Concept 1.1 What are errors ...

MySQL index principle and query optimization detailed explanation

Table of contents 1. Introduction 1. What is an i...

Detailed discussion of the character order of mysql order by in (recommended)

//MySQL statement SELECT * FROM `MyTable` WHERE `...

Introduction to useRef and useState in JavaScript

Table of contents 1. useState hook 2. useRef hook...