CSS로 카운터를 생성하거나 재설정하려면 counter-reset 속성을 사용하십시오.
다음 코드를 실행하여 카운터 재설정 을 구현할 수 있습니다. 재산
예시
<!DOCTYPE html>
<html>
<head>
<style>
body {
counter-reset: section;
}
h2::before {
counter-increment: section;
content: "Fruit " counter(section) " - ";
}
</style>
</head>
<body>
<h1>Fruits</h1>
<h2>Mango</h2>
<h2>Kiwi</h2>
</body>
</html>