css counter increment

Solutions on MaxInterview for css counter increment by the best coders in the world

showing results for - "css counter increment"
Sarah
17 Aug 2018
1<!DOCTYPE html>
2<html>
3<head>
4   <style>
5   	body{
6      counter-reset: myCounter; /* sets myCounter to 0 */
7    }
8    h2::before{
9      counter-increment: myCounter; /* Increments myCounter by 1 */
10      content: counter(myCounter) ": ";
11    }
12   </style>
13</head>
14<body>
15	<h1>CSS counter-increment Property</h1>
16	
17    <h2>This is a heading</h2>
18    <h2>This is a heading</h2>
19    <h2>This is a heading</h2>
20    <h2>This is a heading</h2>
21    <h2>This is a heading</h2>
22    
23</body>
24</html>