KandZ – Tuts

We like to help…!

HTML 12 – unordered, ordered lists, list items and description list

unordered list

<ul>
  <li>First item</li>
  <li>Second item</li>
  <li>Third item</li>
</ul>

You can also have nested lists

Unordered list is a list that does not have a numbered sequence

It is used when it is not imporant for the items to be in order

You can add as many items you need using the list item element

ordered list

<ul type="1">
  <li>First item</li>
  <li>Second item</li>
  <li>Third item</li>
</ul>
  • Ordered list has a numbered sequence
  • It is used when the order of the list items is important
  • You can also have as many items you need using the list item element
  • type attribute defines the way the items will be numbered
  • with 1, the sequence will be 1,2,3…
  • with a, the sequence will be a,b,c…

description list

<dl>
  <dt>Term 1</dt>
  <dd>Definition of Term 1.</dd>

  <dt>Term 2</dt>
  <dd>Definition of Term 2.</dd>

  <dt>Term 3</dt>
  <dd>Definition of Term 3.</dd>
</dl>
  • description or definition list provides definitions for terms
  • dt element marks the definition list terms
  • dd element marks the definitions
  • You can add as many definitions list terms and definitions to the list by adding more dt and dd elements

Leave a Reply