- var n = 1;
ol
while n <= 100
li= `Item ${n++}`
View Compiled
ol {
// Define & Initialize Counter
counter-reset: items;
list-style-type: none;
}
li {
// Increment Counter
counter-increment: items;
&:before {
color: red;
// Display Counter
content: "00" counter(items) ". ";
}
&:nth-child(n + 10):before {
// Display Counter
content: "0" counter(items) ". ";
}
&:nth-child(n + 100)::before {
// Display Counter
content: counter(items) ". ";
}
}
View Compiled
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.