1. All tags must have a corresponding end tag Previously in HTML, you could open tags such as <p> and <li> without necessarily writing the corresponding </p> and </li> to close them. But this is not legal in XHTML. XHTML requires a strict structure and all tags must be closed. If it is a single unpaired tag, add a "/" at the end of the tag to close it. For example: <br /><img height="80" alt="Web Designer" src="../images/logo_w3cn_200×80.gif" width="200" /> 2. The names of all elements and attributes of tags must be lowercase. <br />Unlike HTML, XHTML is case sensitive. <title> and <TITLE> are different tags. XHTML requires that all tag and attribute names must be lowercase. For example: <BODY> must be written as <body>. Mixing uppercase and lowercase letters is also not recognized. Usually, the attribute name "onMouseOver" automatically generated by Dreamweaver must also be changed to "onmouseover". 3. All XHTML tags must be nested properly Also, because XHTML requires a strict structure, all nesting must be in order. Previously, we wrote the code like this: <p><b></p>/b> must be modified to: <p><b></b>/p> That is to say, the nesting layers must be strictly symmetrical. 4. All attributes must be enclosed in quotation marks "" In HTML, you don't have to quote attribute values, but in XHTML, they must be quoted. For example: <height=80> must be changed to: <height="80"> In special cases, you need to use double quotes in the attribute value. You can use ", and single quotes can be used ', for example: <alt="say'hello'"> 5. Encode all < and & special symbols Any less-than sign (<) that is not part of a tag must be encoded as & lt ; Any greater-than sign (>) that is not part of a tag must be encoded as > Any ampersand (&) that is not part of an entity must be encoded as & Note: There is no space between the above characters. 6. Assign a value to all attributes XHTML stipulates that all attributes must have a value, and those without a value must repeat themselves. For example: <td nowrap> <input type="checkbox" name="shirt" value="medium" checked> Must be modified to: <td nowrap="nowrap"> <input type="checkbox" name="shirt" value="medium" checked="checked"> 7. Don’t use “–” in comments "–" can only occur at the beginning and end of an XHTML comment, i.e. they are no longer valid within the content. For example, the following code is invalid: <!–Comment here———–Comment here–> Replace the internal dashes with equal signs or spaces. <!–Comment here============Comment here–> Some of the above specifications may seem strange, but all of these are to make our code have a unified and unique standard to facilitate future data reuse. |
<<: Solution to the problem that mixin does not work in scss (browser cannot compile it)
>>: I have sorted out some domestic design websites that I think are good.
1. When the width of the adjacent floating layer o...
Regarding the issue that JavaScript strict mode d...
The progress bar is not smooth I believe that mos...
CocosCreator version: 2.3.4 Cocos does not have a...
MySQL trigger syntax details: A trigger is a spec...
The powerful tool cgroup in the kernel can not on...
I recently watched Rich Harris's <Rethinki...
1, %: represents any 0 or more characters. It can...
Effect The effect is as follows Implementation ...
Table of contents 1. Generate a certificate 2. En...
This article example shares the specific code of ...
Recently, I received a requirement for function ex...
I have been researching Linux recently and tried ...
Table of contents question Reproduction Implicit ...
This article shares the specific code of using ca...