liveBook · Manning

List item element

As explained in Web Design Playground, Second Edition

A list item is one entry in an ordered or unordered list.

A list item is one entry in an ordered or unordered list. In HTML, the <li> element holds the item text, while an <ol> or <ul> element provides the surrounding list. section 3.10 section 3.8

Choose the surrounding list element according to how the items should behave:

  • Use <ol> when position or sequence matters; the browser supplies and updates the numbers automatically. section 3.8
  • Use <ul> when items belong together but do not need numeric order; the browser supplies bullets automatically. section 3.9
  • Write each item between an opening <li> tag and a recommended closing </li> tag. section 3.8 section 3.9

A numbered list

<ol> <li>Choose ingredients</li> <li>Mix everything</li> <li>Serve</li> </ol> The browser displays these entries as numbered items and adjusts the numbers if an item is inserted or removed. section 3.8

<h3>Top 10 Modern Words of Unknown Origin</h3>
<ol>                                     #1
    <li><em>jazz</em> (1909)</li>        #2
    <li><em>jive</em> (1928)</li>        #2
    <li><em>bozo</em> (1920)</li>        #2
    <li><em>dork</em> (1964)</li>        #2
    <li><em>pizzazz</em> (1937)</li>     #2
    <li><em>humongous</em> (1970)</li>   #2
    <li><em>gismo</em> (1943)</li>       #2
    <li><em>zit</em> (1966)</li>         #2
    <li><em>reggae</em> (1968)</li>      #2
    <li><em>mosh</em> (1987)</li>        #2
</ol>                                    #1

See a complete <ul> containing several <li> elements, with the list container and individual entries marked separately. section 3.9

How Web Design Playground, Second Edition covers it

How deep it goes
Defines the tag, container relationship, browser markers, and closing-tag practice without covering advanced list behavior.
Examples
Uses procedures, top-ten rankings, to-do lists, grocery lists, traits, prerequisites, and word-formation examples.
What it assumes
Assumes basic HTML tag syntax while teaching list containers, item tags, automatic markers, and list-selection choices.
What you can do after
Build it from scratch by placing item text inside <li> elements within <ol> or <ul> containers.
How it connects
Connects list item elements to ordered lists, unordered lists, description lists, and the CSS list-style-type property.

Also explained in

Compare how 3 books explain list item element →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Web Design Playground, Second Edition. The section links point to the parts of the book it draws on.