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

Installation and daemon configuration of Redis on Windows and Linux

# Installation daemon configuration for Redis on ...

Detailed explanation of how to implement secondary cache with MySQL and Redis

Redis Introduction Redis is completely open sourc...

Steps to install superset under win10 system

Superset is a lightweight self-service BI framewo...

How to use Linux locate command

01. Command Overview The locate command is actual...

Understanding Vuex in one article

Table of contents Overview Vuex four major object...

Detailed explanation of Linux lsof command usage

lsof (list open files) is a tool to view files op...

CentOS 6.5 i386 installation MySQL 5.7.18 detailed tutorial

Most people compile MySQL and put it in the syste...

Vue+echart realizes double column chart

This article shares the specific code of vue+echa...

HTTP header information interpretation and analysis (detailed summary)

HTTP Header Explanation 1. Accept: Tells the web s...

el-table in vue realizes automatic ceiling effect (supports fixed)

Table of contents Preface Implementation ideas Ef...

A brief discussion on the problem of forgotten mysql password and login error

If you forget your MySQL login password, the solu...

MYSQL subquery and nested query optimization example analysis

Check the top 100 highest scores in game history ...

How to add interface listening mask in Vue project

1. Business Background Using a mask layer to shie...