Here is a label nesting rule that must be followed under HTML 4 Strict and XHTML 1.0 Strict, for example, you can't <a>
embed a <a>
convention like that inside.
Description
- For the convenience of readers, the labels in this article use uppercase (according to XHTML rules, element names must be lowercase, such as not)
- Lowercase words indicate a group or series of HTML tags
- Each entry (label) follows a list of labels and, if not, indicates that the entry (label) is not allowed to contain any labels inside. This means that the entry can contain only plain text content (#PCDATA, see below). If indicated (empty), this means that the entry is not allowed to contain any form of content. For Flow,inline,block,object and body, the content that is allowed to be contained inside is given separately in the text.
- #PCDATA means "parsed character data", that is, plain text content (excluding any HTML tags, but escape content can exist, such as Ä and ä)
- CDATA means "character data," meaning that the plain text content of the escaped content is not included, and the details can refer to CDATA confusion
- Excluding ... means not directly or indirectly including the listed elements
Note 1. The above content is based on the Strict DTD for HTML 4.01 specification. Junchen translation from allowed nesting to elements in HTML 4 Strict (and XHTML 1.0 Strict)
Note 2. For XHTML 1.0, basically consistent, different points are as follows:
- The
<script>
content for and <style>
, in HTML 4, is CDATA
while in XHTML it is #PCDATA
- In XHTML, the
<table>
tag can be followed by one <tr>
, but in HTML 4.01, this is not allowed, but <tbody>
the label can be omitted. This means that if the code is <table>
followed immediately <tr>
, for HTML 4.01, a label will be generated implicitly <tbody>
, but not in XHTML. This affects the style sheet used tbody
as a selector.