fix counter.md
This commit is contained in:
@ -43,36 +43,38 @@ Counters are, in essence, variables maintained by CSS whose values may be increm
|
|||||||
|
|
||||||
#### Demo
|
#### Demo
|
||||||
|
|
||||||
<section class="countable-section">
|
<div class="snippet-demo">
|
||||||
<div class="countable-item">
|
<section class="snippet-demo__countable-section">
|
||||||
|
<div class="snippet-demo__countable-item">
|
||||||
<p>Some item</p>
|
<p>Some item</p>
|
||||||
<div class="countable-section">
|
<div class="snippet-demo__countable-section">
|
||||||
<p>First sub item</p>
|
<p>First sub item</p>
|
||||||
<p>Second sub item</p>
|
<p>Second sub item</p>
|
||||||
<p>Third sub item</p>
|
<p>Third sub item</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="countable-item">
|
<div class="snippet-demo__countable-item">
|
||||||
<p>Second other item</p>
|
<p>Second other item</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="countable-item">
|
<div class="snippet-demo__countable-item">
|
||||||
<p>Third item</p>
|
<p>Third item</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="countable-item">
|
<div class="snippet-demo__countable-item">
|
||||||
<p>Fourth item</p>
|
<p>Fourth item</p>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
</div>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
.countable-section {
|
.snippet-demo__countable-section {
|
||||||
counter-reset: counter1;
|
counter-reset: counter1;
|
||||||
}
|
}
|
||||||
.countable-item p {
|
.snippet-demo__countable-item p {
|
||||||
counter-increment: counter1;
|
counter-increment: counter1;
|
||||||
}
|
}
|
||||||
.countable-item p:before {
|
.snippet-demo__countable-item p:before {
|
||||||
content: counters(counter1, '.') ' ';
|
content: counters(counter1, '.') ' ';
|
||||||
font-weight: bold; /* for better visualization on demo */
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
@ -96,4 +98,4 @@ You can create a ordered list using any type of HTML.
|
|||||||
|
|
||||||
* https://caniuse.com/#search=counters
|
* https://caniuse.com/#search=counters
|
||||||
|
|
||||||
<!-- tags: visual -->
|
<!-- tags: visual, other -->
|
||||||
|
|||||||
Reference in New Issue
Block a user