»

Counting Elements

Zählt dynamisch HTML Elemente und stellt den Wert in CSS bereit.

Syntax:

css
section { counter-increment: [individual Name of the Counter] }

Using the Counter-Increment

css
section { counter-increment: section-counter; } /* Prints Out the increasing number in front of the section title */ .secton-title::before { content: counter(section-counter); }

Adding some opacity, point and space.

css
/* Prints Out the increasing number in front of the section title */ .secton-title::before { opacity: .5; content: counter(section-counter) ". "; }
×