How to create HTML lists

There are two types of HTML lists – the ordered list and the unordered list. The unordered list will display your list with bullets while the ordered list will assign ongoing numbers to the list. Lets start with the unordered list which is used most often

<ul>
<li>List item 1</li>
<li>List item 2</li>
<li>List item 3</li>
</ul>

The beginning and finishing ul-tag defines that this is an unordered list. Next we wrap each list item ind the beginning and finishing li-tags. This list contains 3 items displayed with a bullet in front of each item like this:

  • List item 1
  • List item 2
  • List item 3

Let’s take a look at the ordered list…

<ol>
<li>List item 1</li>
<li>List item 2</li>
<li>List item 3</li>
</ol>

The only difference is the naming. Instead of ul we use ol. This will be the output…

  1. List item 1
  2. List item 2
  3. List item 3

  Written by: Michael from Beginnrtuts.com     25-08-2022     Written in: HTML tutorials

Leave a Reply

Your email address will not be published.