A list item element marks one entry in an HTML list. Write the entry between opening and closing <li> tags, then place it inside an <ol> ordered-list container or a <ul> unordered-list container. section 3.18 section 3.15
Choose the list container according to the kind of collection you are making:
- Use <ol> when the entries belong in a sequence, such as recipe steps, instructions, document sections, or rankings. The browser supplies numbers and updates them when entries are inserted or removed. section 3.14
- Use <ul> when the entries are related but have no required numeric order, such as groceries, tasks, traits, or prerequisites. The browser supplies bullets automatically. section 3.16
- Change the marker style with the CSS list-style-type property, including decimal, alphabetic, Roman numeral, Greek, disc, circle, or square styles. section 3.15 section 3.17
A tiny numbered list
Wrap each entry in <li> tags: <ol><li>Choose ingredients</li><li>Mix everything</li><li>Serve</li></ol>. The browser displays the entries as 1, 2, and 3 without manually typed numbers. section 3.14
<li>Item text</li>
Use this compact pattern as a starting point for either an ordered or unordered list. section 3.14 section 3.16


