In HTML 5, the li tag defines an item in a list.
When Do You Use the li Tag in HTML 5?
In HTML 5, you use the li tag with other tags to create either an ordered list ol, an unordered list ul, or a menu list. If the order of the listed items is important, then you would choose an ordered list. If the order of the items is not important, use an unordered list. We’ll talk more about the menu type list in a later post.
How Is the li Tag Used in HTML 5 Documents?
Here is a simple example:
<h2>A list where order is important</h2>
<ol>
<li>Get in the car</li>
<li>Buckle up</li>
<li>Put the key in the ignition</li>
<li>Start the car by turning the key</li>
</ol>
<h2>A list where order is not important</h2>
<ul>
<li>Milk</li>
<li>Orange Juice</li>
<li>Bread</li>
</ul>
