back to home

HTML Lists

  1. HTML lists are defined with the < ul > (unordered/bullet list) or the < ol > (ordered/numbered list) tag, followed by < li > tags (list items)
    Unordered List Ordered List Nested list
    • Item 1
    • Item 2
    • Item 3
    • Item 4
    • Item 1
    • Item 2
    • Item 3
    • Item 4
    • Item 1
    • Item 2
    • Item 3
    • Item 4
    • Item 1
    • Item 2
    • Item 3
    • Item 4
    1. Item 1
    2. Item 2
    3. Item 3
    4. Item 4
    1. Item 1
    2. Item 2
    3. Item 3
    4. Item 4
    1. Item 1
    2. Item 2
    3. Item 3
    4. Item 4
    1. Item 1
    2. Item 2
    3. Item 3
    4. Item 4
    1. Item 1
    2. Item 2
    3. Item 3
    4. Item 4
    • Item 1
    • Item 2
      • Nest Item 1
      • Nest Item 2
    • Item 3
    • Item 4
  2. HTML also supports description lists. Example:
    Coffee
    - black hot drink
    Milk
    - white cold drink
              
              < dl>
                < dt>Coffee< /dt>
                < dd>- black hot drink< /dd>
                < dt>Milk< /dt>
                < dd>- white cold drink< /dd>
              < /dl>
            
            

    The < dl> tag defines the description list, the < dt> tag defines the term (name), and the < dd> tag describes each term.

  3. By default, an ordered list will start counting from 1. If you want to start counting from a specified number, you can use the start attribute:
            < ol start="50">
              < li>Coffee< /li>
              < li>Tea< /li>
              < li>Milk< /li>