concept
Implicit list item counter — CSS reference
List items participate in the built-in list-item counter. Ordered HTML lists establish numbering from attributes such as start and value. A marker may format that counter explicitly without replacing native list semantics. In the tested Chromium, custom counter(list-item) did not reflect the HTML value attribute alone, despite correct native numbering. The fixture uses an explicit counter-set on the item as a local workaround; prefer native markers when possible.
Formal Syntax & Structure
css syntaxcss
li::marker { content: counter(list-item) ": "; }Working Example
Example Snippetcss
<!doctype html><html lang="en"><meta charset="utf-8"><title>Implicit list-item counter</title><style>body{margin:0}#a{padding:8px;background:rgb(232,237,241);color:rgb(0,0,0);box-sizing:border-box}body{font:16px/1.5 sans-serif}#a{margin:16px;padding:8px 8px 8px 80px;background:white}li{padding-left:4px}li::marker{content:counter(list-item) ": "}li[value]{counter-set:list-item 9}</style><body><ol id="a" start="5"><li>ONE</li><li value="9">TWO</li><li>THREE</li></ol></body></html>