By
11/02/2016   Comments Off on CSS Content Counter with Decimal Leading Zero

View all snippets

.numbering { counter-reset:section }
.numbering h2:before { 
     counter-increment:section; 
     content:counter(section, decimal-leading-zero) ". ";
}

HTML looks like this:

<div class="numbering">
   <h2>Headline 1</h2>
...
   <h2>Heading 2</h2>
...
</div>