XHTML code written rules

Related Tags:

  We first find out the code web standards specifications.    Understanding of these norms can help you make detours less, as soon as possible through the code validation. 

  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. 

Related articles:

CSS code attributes Encyclopaedia (HTML)
  CSS text attributes:    Color: # 999999; / * text color * /    Font-family: 10 lines, sans-serif; / * text font * /    Font-size: 9pt; / * text size * /    Font-style: itelic; / * [italics * /    Font-variant: small-caps; / * Small font *...
Flash animation Revelation large colorful marine world
  Brought in the most popular online the most popular animation software, we may think of a Flash will be, "Little action works Series," "Northeast people are Guoleifeng", "big three", etc. These widely on the Internet spread the majority of Internet users are very...
Chinese version of the Flash 8 Video Guide (5) Angle
  Article 05 sets: Angle    Curriculum points: Chinese version of the Flash 8 Video Guide, a total of 20 sets, and lead you to experience and learn new features Flash 8 new features!    [Full-screen viewing] | [download video]  <EMBED QUALITY=high PLUGINSPAGE="htt...
Google rules from the adjustment of China's status quo SEO
  Google rules of this adjustment, the same as in China in the event of a small-scale earthquake, a large number of SEO companies do better from the original site into the rankings disappeared without a trace.    A few days ago some phone network technical staff to consult and exchan...
Flash video tutorial examples: computer production at titles (3)
  Article 61: Computer reportedly produced titles (3)    Curriculum objectives: to produce computer animation titles    Curriculum points: use Flash MX 2004 produced computer animation at first, the example set on seven points, which is the third quarter.    At ...