HTML & CSS Wiki
Advertisement

Lists may be placed in a page using these tags: <ol> (ordered list) and <ul> (unordered list). Items are placed inside them using the <li> (list item) tag. Following is a table showing the two lists side-by-side:

HTML Output
<ul>
  <li>Category 1</li>
  <ul>
    <li>Item 1-1</li>
    <li>Item 1-2</li>
    <li>Item 1-3</li>
  </ul>
  <li>Category 2</li>
  <ul>
    <li>Item 2-1</li>
  </ul>
</ul>
  • Category 1
    • Item 1-1
    • Item 1-2
    • Item 1-3
  • Category 2
    • Item 2-1
<ol>
  <li>Category 1</li>
  <ol>
    <li>Item 1-1</li>
    <li>Item 1-2</li>
    <li>Item 1-3</li>
  </ol>
  <li>Category 2</li>
  <ol>
    <li>Item 2-1</li>
  </ol>
</ol>
  1. Category 1
    1. Item 1-1
    2. Item 1-2
    3. Item 1-3
  2. Category 2
    1. Item 2-1

External links[]

Advertisement