Encodera

Thanks for reading!

Donate to the site — we work hard for you.

HTML & CSS reference

<li>

An item of a `<ul>`, `<ol>` or `<menu>` list.

Syntax

<li>Item</li>

Attributes

ParameterTypeDescription
valuenumberOptional. The item's number in an `<ol>`.

Examples

A nested list inside an item:

<ul>
  <li>Hot drinks
    <ul>
      <li>Espresso</li>
      <li>Tea</li>
    </ul>
  </li>
  <li>Cakes</li>
</ul>

Notes

A nested list goes inside an <li>, not between items. An item may contain anything: links, images, paragraphs.

See also

  • <ul> — A bulleted list: items whose order does not matter.
  • <ol> — A numbered list: items whose order matters.
  • <menu> — A list of commands — for example, a toolbar; behaves like `<ul>`.

Related recipes

In the tutorial

  • Lists — Bulleted and numbered lists, numbering options, nested lists and description lists in HTML.

Thanks for reading!

Donate to the site — we work hard for you.