<div id="description">
<h2>Приклад з функцією counters()</h2>
<p>Використання функції counters() для створення списків.</p>
</div>
<div id="result">
<ol>
<li>Елемент 1</li>
<li class="custom-counter">Елемент 2</li>
</ol>
</div>
#description {
font-style: italic;
text-align: left;
line-height: 1.5;
margin-bottom: 50px;
padding: 12px 16px;
background-color: #f7f7f7;
border: 1px solid #ccc;
}
ol {
list-style: none;
}
li:before {
content: counters(custom-counter, ".") ". ";
counter-reset: custom-counter;
}
.custom-counter:before {
counter-increment: custom-counter;
content: counters(custom-counter, ".") ". ";
}
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.