CSS counter

HTML
<body> <div class="counter"> <span>Item </span> <span>Item </span> <span>Item </span> <span>Item </span> <span>Item </span> <span>Item </span> </div> </body>
CSS
body { counter-reset: section; padding: 20px; } .counter>span{ display: block; font-size: 20px; } .counter>span::after { counter-increment: section; content: " - " counter(section); }
JAVASCRIPT
Expand for more options Login