In this example, we use the counter()
function three times.
HTML
<ol>
<li></li>
<li></li>
<li></li>
</ol>
CSS
We include the counter()
function with three different counter styles, including the default decimal value. We've added padding to the list to provide space for the long ::marker
string.
ol {
counter-reset: listCounter;
padding-left: 5em;
}
li {
counter-increment: listCounter;
}
li::marker {
content:
"Item #" counter(listCounter) " is: ";
}
li::after {
content:
"[" counter(listCounter, decimal-leading-zero) "] == ["
counter(listCounter, upper-roman) "]";
}
Result