Before you start formal content production, we must first understand the specifications for the web standard. Understanding these specifications can help you take less detours and pass the code verification as soon as possible.
1. All tags must have a corresponding end tag
Previously in HTML, you can open a number of labels, such as
and
2. The names of all tags and attributes must use lowercase
Unlike HTML, XHTML is sensitive to case,
3. All XML tags must be reasonable nested
Also because XHTML requires a rigorous structure, all nesters must be written in order, before we write this code:
p> / b>
Must be modified to:
b> / p>
That is to say, the nest of one layer must be strictly symmetrical.
4. All attributes must be quoted ""
In HTML, you don't need to add quotes to attribute values, but in XHTML, they must be an extension. E.g:
Must be modified to:
Special circumstances, you need to use double quotes in the attribute value, you can use ", single quotes can be used, for example:
5. Represent all Any smaller than the number (<), not part of the label, must be encoded as & lt; any greater than the number (>), not part of the label, must be encoded as & gt; any number (&), not entity Part of it must be encoded as & amp; Note: There is no space between the above characters. 6. Give all attributes a value XHTML specifies that all attributes must have a value, and no value is repeated. E.g: Must be modified to: "-" can only occur in the beginning and end of XHTML annotation, that is, they are no longer effective in content. For example, the following code is invalid: Replace the internal dashed line with an equal number or space. These specifications have a strange thing, but all this is to make our code a unified, unique standard, which is convenient for future data reuse.
7. Do not make "-" in the comment content