Before we start the formal content production, we must first look at the specifications of the Web standards Code. Understanding these specifications can help you take fewer detours and pass code verification as soon as possible. 1. All tags must have a corresponding end tag Previously in HTML, you could open a number of tags, such as and without necessarily writing the corresponding and to close them. But this is not legal in XHTML. XHTML requires a rigorous structure, and all tags must be closed. If it is a single, unpaired label, add a "/" at the end of the label to close it. For example:<BR/>2. All label elements and attributes must be named with lowercase Unlike HTML, XHTML is sensitive to case, and is a different label. XHTML requires that all labels and attribute names must be in lowercase. For example,: must be written in . Case-by-case inclusions are also not recognized, usually Dreamweaver automatically generated property names "onmouseover" must also be modified to "onmouseover." 3. All XML tags must be nested properly Also because XHTML requires a rigorous structure, all nesting must be in order, as previously written code: /b>Must be modified to: /p> That is, a layer of nesting must be strictly symmetric. 4. All attributes must be enclosed in quotation marks "" In HTML, you may not need to enclose attribute values in quotes, but in XHTML they must be quoted. For example: Must be modified to: "In special cases, you need to use double quotes in the attribute value, which you can use ", single quotes", for example: 5. Encode all < and & special symbols
- Any less than (<), which is not part of the label, must be encoded as & L T;
- Any greater-than sign (>), which is not part of the label, must be encoded as & G T;
- Any number (&), which is not part of the entity, must be encoded as & a M p;
Note: There are no spaces between the above characters. 6. Assign a value to all properties XHTML stipulates that all attributes must have a value, and that no value repeats itself. For example: <TD nowrap> Must be modified to: <TD nowrap= "nowrap" > 7. Do not in the annotation content to make "--" "--" can only occur at the beginning and end of XHTML annotations, that is, they are no longer valid in the content. For example, the following code is not valid: Replaces the internal dashed line with an equal sign or a space. Some of these specifications look strange, but all of this is to make our code have a unified, unique standard for future data reuse.
|