CKTIS / HTML
li — list item
The `li` element represents an item in an `ol`, `ul`, or `menu` list. Its `value` attribute can change an item's number in an ordered list.
Version: WHATWG HTML Living Standard; index snapshot date recorded separately
Syntax
<ol>
<li>...</li>
<li value="3">...</li>
</ol>The li element represents a list item. Place it as a direct child of ol, ul, or menu, rather than as a standalone element outside a list.
It accepts flow content, including paragraphs and nested lists. Put a nested list inside the relevant li.
In ol, the integer value attribute sets an item's ordinal number and affects subsequent numbering. Do not use it in ul or menu. The example produces numbers 1, 3, 4.
In text/html, the end tag may be omitted immediately before another li or when no content remains in its parent. Explicit </li> tags improve readability.
Examples
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>List items</title>
</head>
<body>
<ol>
<li>Alpha</li>
<li value="3">Beta</li>
<li>Gamma</li>
</ol>
</body>
</html>Result
1. Alpha 3. Beta 4. Gamma
The displayed code and declared result were verified in an isolated environment using the method recorded in the verification evidence for this exact version.