Codectionary / Developer documentation / HTML

<li>

The <li> element represents an individual item within a list — <ul>, <ol>, or <menu>. Its rendering depends on its parent: inside <ol>, browsers add sequential numbering; inside <ul>, they add bullet points. The value attribute lets you override an item's number specifically within an ordered list.

Syntax

<ul>
  <li>List item content</li>
</ul>

Examples

Basic List Items

Simple items within an unordered list.

<ul>
  <li>First item</li>
  <li>Second item</li>
  <li>Third item</li>
</ul>

List Item with Rich Content

A list item can contain more than plain text.

<ul>
  <li>
    <strong>HTML</strong> — the structure of the web
  </li>
  <li>
    <strong>CSS</strong> — the styling of the web
  </li>
</ul>

Overriding a Specific Item Number

Using the value attribute inside an ordered list.

<ol>
  <li>Step one</li>
  <li value="5">Jump to step five</li>
  <li>Step six</li>
</ol>

Attributes

  • value (number): Overrides the item's number when inside an <ol> (has no effect inside <ul>)

Best practices

  • Only use <li> as a direct child of <ul>, <ol>, or <menu>
  • A list item can contain block-level content like paragraphs or nested lists, not just plain text
  • Use the value attribute sparingly, only when you genuinely need to break the natural numbering sequence
  • Avoid using li outside of a list container just to get default spacing or bullet styling

Browser compatibility

Support applies to the named feature, not every attribute or behaviour in this article. Versions refer to browsers, not operating systems.

<li>

Desktop

Chrome
Supported
From 1
Firefox
Supported
From 1
Safari
Supported
From 3
Edge
Supported
From 12
Opera
Supported
By 12.1 (possibly earlier)

Mobile

Safari on iOS
Supported
From 1
Chrome for Android
Supported
From 18
Firefox for Android
Supported
From 4
Samsung Internet
Supported
From 1.0

MDN BCD record for this feature · MDN reference

Support history and limitations

Chrome

  • From 1

Firefox

  • From 1

Safari

  • From 3

Edge

  • From 12

Opera

  • By 12.1 (possibly earlier)

Safari on iOS

  • From 1

Chrome for Android

  • From 18

Firefox for Android

  • From 4

Samsung Internet

  • From 1.0
<li> value

Desktop

Chrome
Supported
From 1
Firefox
Supported
From 1
Safari
Supported
By 4 (possibly earlier)
Edge
Supported
From 12
Opera
Supported
By 12.1 (possibly earlier)

Mobile

Safari on iOS
Supported
By 3.2 (possibly earlier)
Chrome for Android
Supported
From 18
Firefox for Android
Supported
From 4
Samsung Internet
Supported
From 1.0

MDN BCD record for this feature

Support history and limitations

Chrome

  • From 1

Firefox

  • From 1

Safari

  • By 4 (possibly earlier)

Edge

  • From 12

Opera

  • By 12.1 (possibly earlier)

Safari on iOS

  • By 3.2 (possibly earlier)

Chrome for Android

  • From 18

Firefox for Android

  • From 4

Samsung Internet

  • From 1.0

MDN BCD 8.1.5 · Dataset built 2026-10-08 · Mapping reviewed 2026-10-21. These dates are not individual browser-test or claim-verification dates. Unknown means the data does not establish support.

HTML Living Standard

Specifications & further reading