In fact, there are two types of XHTML 1.0 (if it is added to Frameset DOCTYPE, it is considered three, which will not be discussed in this article), Transitional (transitional) and Strict (strict) DOCTYPEs. And HTML 4.01 also has the same documentation statement.
Today, when promoting web standards, those who advocate web standards often say that XHTML is more stringent than HTML, of course, in a sense, for example, it requires all tags to be closed and all attributes are quoted. But in fact, XHTML 1.0 is divided into two types (if it is added to Frameset DOCTYPE, it is considered three, not discussed in this article), Transitional (transitional) and Strict (strict) DOCTYPEs. And HTML 4.01 also has the same documentation statement.
Literally, the meaning is: Transitional DOCTYPEs are just to achieve the transition from the old era to the new era, and Strict DOCTYPEs are the default document declaration, which is applicable to constructing HTML 4.01 and XHTML 1.0.
Using Transitional DOCTYPE is usually due to the fact that the code contains too many old writing methods, and it is difficult to completely convert to Strict DOCTYPE at once. But Strict DOCTYPE should be your goal. It encourages and sometimes forces you to distinguish structure from presentation and write all the code of presentation in CSS. HTML 4 Document Type Definition:
This HTML 4.01 Strict DTD does not include presentation layer attributes and tags. W3C will gradually eliminate these attributes and tags, and you can fully implement them using style sheets. You should use Strict DTD, and for support for presentation layer properties and tags, use Transitional DTD.
There is also an advantage of using Strict DOCTYPE, which allows browsers to render pages using their most stringent and (to some extent) the most standard-compliant mode.
Tommy Olsson explains the benefits of using Strict in his article Ten questions for Tommy Olsson at Web Standards Group:
I think using Strict DTD, whether it is HTML 4.01 Strict or XHTML 1.0 Strict, is much more important than discussing whether to use HTML or XHTML. It represents the quality of the future Internet. It separates structure and performance, making maintaining a site very easy.
For those who are just beginning to get involved in web standards and correct, semantic structures, it is important to recognize the difference between Transitional and Strict DOCTYPEs. For more detailed lists, please refer to: XHTML: Differences between Strict & Transitional, Comparison of Strict and Transitional XHTML and XHTML1.0 Element Attributes by DTD.
For those who are preparing to move to Strict, some differences between the two are likely to cause developers to make mistakes, and I will talk about it next. Tags not supported under Strict DOCTYPEs center font iframe srike u properties not supported under Strict DOCTYPEs align (table-related support: col, colgroup, tbody, td, tfoot, th, thead, and tr) language background bgcolor border (table-supported) height (img and object support) hspace name (supported in HTML 4.01 Strict, form and img in XHTML 1.0 Strict) noshade nowrap target text, link, vlink, and link vspace width (img, object, table, col, Both support and colgroup) Differences in content models
The content model of element type describes what instances of element type can be included. In this regard, the biggest difference between the two document declarations is that blockquote, body, and form elements can only contain block-level elements, such as: text and images are not allowed to be directly contained in the body. They must be included by block-level elements such as p or div. The input element cannot be directly the text within the next layer of the form element. They must be included by block-level elements such as p or div. All representations are handed over to CSS, and the Strict standard is adhered to.
In the transition to Strict DOCTYPEs, it is much more effective to understand what each element does than to know what each element looks like.
First consider structure and semantics, then worry about performance.