liveBook · Manning

List item element

As explained in Build a Website with ChatGPT

A list item is the HTML li element that represents one item within an ordered or unordered list.

A list item is an HTML <li> element representing one item in an ordered or unordered list. Each item is enclosed by an opening <li> tag and a closing </li> tag. section 9.2 section 9.3

Choose the surrounding list element according to whether order matters:

  • Place <li> elements inside <ul> for an unordered, bulleted list when item order is not essential. section 9.2
  • Place <li> elements inside <ol> for an ordered, numbered list when sequence matters, such as instructions or rankings. section 9.3
  • Keep each item readable: an item may contain several sentences, but overly long items become harder to scan. section 9.2.1

A short unordered list

<ul> <li>Francis</li> <li>Haden</li> <li>Honey</li> </ul> The <ul> element creates the bulleted list, while each <li> element supplies one item. section 9.2

<ol>
    <li>Inflatable Dartboard</li>
    <li>Water-Resistant Sponge</li>
    <li>Helium-Filled Paperweight</li>
    <li>Teflon Bath Mat</li>
    <li>Flame-Retardant Firewood</li>
</ol>

Inspect a complete numbered-list example to see how several <li> elements fit inside an <ol> element. section 9.3

When editing a page, change the text between the <li> and </li> tags without deleting the tags themselves. section 9.6

How Build a Website with ChatGPT covers it

How deep it goes
Defines the enclosing tags and demonstrates short and long entries, but stops short of deeper HTML parsing or browser internals.
Examples
Uses mango names, book recommendations, and novelty-product rankings as list-item examples.
What it assumes
Assumes basic page editing while teaching the meanings of ul, ol, li, and their opening and closing tags.
What you can do after
Build unordered or ordered HTML lists and safely revise the text inside their list item tags.
How it connects
Connects list item elements with unordered lists, ordered lists, bullets, numbering, and nested lists.

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 Build a Website with ChatGPT. The section links point to the parts of the book it draws on.