basics of website design banner photo

HTML

HTML 5

CSS 2.1

CSS 3

Reference



HTML <ul> <ol> and <li> Elements

These three elements define and display items in the form of a list. The <ul> and <ol> elements define the type of list and <li> elements contain each separate item in the list.

Using <ul> will give you an unordered list with simple bullet points, and <ol> shows an ordered list with numbered list items.
Example code:

Unordered
<ul>
<li>First Item</li>
<li>Second Item</li>
<li>Third Item</li>
<li>Fourth Item</li>
</ul>

Ordered
<ol>
<li>First Item</li>
<li>Second Item</li>
<li>Third Item</li>
<li>Fourth Item</li>
</ol>

Which displays:


Unordered list result:
Ordered list result:
  1. First Item
  2. Second Item
  3. Third Item
  4. Fourth Item

Which list to use - ordered or unordered.

The recommendation is to use an ordered list when you are showing a sequence of logical steps which must be followed one after the other such as recipe instructions or assembly details, in other cases an unordered list will suffice.

<ul> <ol> and <li> Attributes

HTML 4 Element List