Lists

Lists are used to group data in a certain order, or it can be ungrouped to display data in a sequential form.

Lists can be of the following types:

  • Unordered
  • Ordered
  • Unstyled
  • Inline
  • Description

Unordered lists

An unordered list is a collection of items in which the order does not matter. Here is the syntax of an unordered list:

<ul>
  <li>...</li>
  <li>...</li>
</ul>

Ordered lists

An ordered list is a collection of items where the order does matter. Here is the syntax of an ordered list:

<ol>
  <li>...</li>
  <li>...</li>
</ol>

Unstyled lists

Unstyled lists can be ordered or unordered with the removal of the left margin and the default list style. Here is the syntax of an unstyled list:

<ul class="list-unstyled">
  <li>...</li>
  <li>...</li>
</ul>

Inline lists

Inline ...

Get Web Developer's Reference Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.