<!DOCTYPE html>
<html>
<head>
<title>CSS counter-increment property</title>
<style>
body {
counter-reset: section;
}
h1 {
counter-reset: subsection;
}
h1:before {
counter-increment: section;
content: "Section " counter(section) ". ";
}
h2:before {
counter-increment: subsection;
content: counter(section) "." counter(subsection) " ";
}
</style>
</head>
<body>
<h1>First List</h1>
<h2>item 1</h2>
<h2>item 2</h2>
<h2>item 3</h2>
<h1>Second List</h1>
<h2>item 1</h2>
<h2>item 2</h2>
<h2>item 3</h2>
</body>
</html>