XHTML code written rules
Related Tags:
1. Have all the markings must be a corresponding marking the end of
In the past, HTML, you can open many labels, such as <p> and <li> and not necessarily write the corresponding </ p> and </ li> to close them. But in XHTML This is not legitimate. XHTML requires strict structure, all labels must be closed. If it is not alone on the label, the label and a final "/" to close it. For example:
<br /> <img Height="80" alt=" Woai DivCSS" src="../images/logo.gif" width="200" />2. Label elements and attributes of the name must use a lowercase
Not the same with HTML, XHTML case-sensitive, and <title> <TITLE> is different labels. XHTML requires all tags and attributes must use a lowercase names. For example: <BODY> must be written <body>. Inclusion case is not recognized, usually dreamweaver automatically generated attribute name "onMouseOver" must be changed into a "onmouseover."
3. All the XML tags must be reasonable nested
The same stringent requirements as XHTML structure, so all must be nested in order before we write this code:
<p> <b> </ P> / b>To be amended as follows:
<p> <b> </ B> / p>That is to say, a level of nested must be strictly symmetrical.
4. Attributes must be in quotation marks "" enclose
In HTML, you can attribute values do not need to quote, but in XHTML, they must be added in quotation marks. For example:
<height=80>To be amended as follows:
<height="80">Special circumstances, you need to attribute value in the use of double quotes, you can use the "single quotes can be used ', for example:
<alt="say'hello'">5. To all <and & special symbol with a code that
Any less than (<), is not part of the label, must be encoded & lt;Any more than ( "), is not part of the label, must be encoded & gt;
Any (&), is not part of the entity, must be encoded & amp;
Note: The above no spaces between characters.
6. Given all the attributes to a value
XHTML requires all property must have a value of no value to repeat itself. For example:
<td Nowrap> <input type="checkbox" name="shirt" value="medium" checked>To be amended as follows:
<td Nowrap="nowrap"> <input type="checkbox" name="shirt" value="medium" checked="checked">7. Do not reside in the content of the Notes "-"
"-" XHTML only in the beginning and the end of the Notes, that is, the content they no longer valid. For example, the following code is not valid:
<! - Is here is here Notes ----------- Notes ->
Equate with the replacement or spaces within the dotted line.
<! - Is here is here Notes ============ Notes ->
These norms have looked rather strange, but everything is in order to make our code with a uniform, the only criterion, the data to facilitate later reuse.
- CSS code attributes Encyclopaedia (HTML)
- How to Optimize your CSS code?
- CSS code-switching function tab
- Css common code
- CSS code structure of: the div and span!
- CSS simple picture-Daolian code
- HTML and CSS pages prepared by the beautiful formal code
- The magic code - CSS filter trip
- Common CSS code
- CSS control ul code base
- CSS style definition of the rolling code
- Js code and code folding effect css
- Css code explain
- Clever css debug code
- CSS code abbreviation skills zz
- CSS code-writing techniques commonly used
- Summary: A CSS code reference map
- Some commonly used CSS code
- CSS code abbreviation skills
- Optimizing your CSS code




