concept
Counter representation — CSS reference
The representation is the text generated from an integer by a counter style. Automatic markers may add prefix and suffix; counter() does not. Compare a native custom-style marker with explicitly generated text using the same style.
Formal Syntax & Structure
css syntaxcss
content: counter(list-item, demo);Working Example
Example Snippetcss
<!doctype html><html lang="en"><meta charset="utf-8"><title>Counter representation</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}@counter-style demo{system:extends lower-roman;prefix:"[";suffix:"] "}#a{list-style:demo inside}#b{list-style:none}#b li::before{content:counter(list-item,demo) ": "}</style><body><ol id="a"><li>ONE</li></ol><ol id="b"><li>TWO</li></ol></body></html>