Leakbali
w3 Tutorial, Web Tutorial
Register   Login
Share

XHTML Elements Must Be Properly Nested 


In HTML, some elements can be improperly nested within each other, like this:
<b><i>This text is bold and italic</b></i>
In XHTML, all elements must be properly nested within each other, like this:
<b><i>This text is bold and italic</i></b>
Note: A common mistake with nested lists, is to forget that the inside list must be within <li> and </li> tags.

This is wrong:
<ul>
  <li>Coffee</li>
  <li>Tea
    <ul>
      <li>Black tea</li>
      <li>Green tea</li>
    </ul>
  <li>Milk</li>
</ul>

This is correct:
<ul>
  <li>Coffee</li>
  <li>Tea
    <ul>
      <li>Black tea</li>
      <li>Green tea</li>
    </ul>
  </li>
  <li>Milk</li>
</ul>
Notice that we have inserted a </li> tag after the </ul> tag in the "correct" code example.
More Tutorial
  1. XHTML - Get Ready For XHTML
  2. XHTML - The most Important Differences
  3. XHTML - XHTML Elements Must Be Properly Nested
  4. XHTML - XHTML Must Always be Closed
  5. XHTML - Empty Elements Must Also Be Closed
  6. XHTML - XHTML Elements Must Be In Lower Case
  7. XHTML - XHTML Documents Must Have One Root Element

Tutorial


References

About Us

Home
About Us
Contact Us
Sitemap

Tools

Google PageRank
Alexa Rank
Keywords Density

Accounts

Register Account
Login
Valid XHTML 1.0 TransitionalValid CSS!
Web Directory


2006 - 2012 © Leakbali.com - Free Web Tutorial, Free Web Articles, Web Sharing, Source Codes, Web References