Saturday, October 20, 2012

HTML Nested list and Definition list


Chapter 15


Example 15:

<html>
<body>

<h4>A nested List:</h4>
<ul>
  <li>Coffee</li>
  <li>Tea
    <ul>
    <li>Black tea</li>
    <li>Green tea
      <ul>
      <li>China</li>
      <li>Africa</li>
      </ul>
    </li>
    </ul>
  </li>
  <li>Milk</li>
</ul>

</body>
</html>


Output is:

A nested List:

  • Coffee
  • Tea
    • Black tea
    • Green tea
      • China
      • Africa
  • Milk

HTML Definition Lists


A definition list is a list of items, with a description of each item.
The <dl> tag defines a definition list.
The <dl> tag is used in conjunction with <dt> (defines the item in the list) and <dd> (describes the item in the list):


Example :16


<html>
<body>

<h4>A Definition List:</h4>
<dl>
  <dt>Coffee</dt>
  <dd>- black hot drink</dd>
  <dt>Milk</dt>
  <dd>- white cold drink</dd>
</dl>

</body>
</html>


Output is:

A Definition List:

Coffee
- black hot drink
Milk
- white cold drink

No comments:

Post a Comment