Home › CSS Tutorial › CSS counters
CSS counters
Number things automatically.
Create with counter-reset, increase with counter-increment, and show with counter() in content.
Example code
<style>
body{counter-reset:s}h3::before{counter-increment:s;content:'Section ' counter(s) ': '}
</style>
<h3>Intro</h3><h3>Body</h3><h3>End</h3>