Using the CSS 'counter-increment' property.