How is CSS counters calculated?

recently, I was reading an article by Zhang Xuxin about css counters. The link is https://www.zhangxinxu.com/wo.. I just don"t understand when I see the following piece. Figures 1.1 and 1.2 are nested in two reset, but 1.3,1.4 are only nested in the outermost reset. Why would they pick it up? How is the internal calculation of counters? ask the boss to explain

CSS Code:

.reset { padding-left: 20px; counter-reset: wangxiaoer; line-height: 1.6; color: -sharp666; }
.counter:before { content: counters(wangxiaoer, "-") ". "; counter-increment: wangxiaoer; font-family: arial black; }
.reset ~ .counter { color: -sharpcd0000; }

HTML Code:

<div class="reset">
    <div class="counter"></div>
    <div class="reset">
        <div class="counter"></div>
        <div class="counter"></div>
        <div class="reset">
            <div class="counter"></div>
            <div class="counter"></div>
            <div class="counter"></div>
        </div>
        <div class="counter"></div>
    </div>
    <div class="counter"></div>
    <div class="counter"></div>
    <div class="reset">
        <div class="counter"></div>
    </div>
</div>





Css
Jul.29,2021

it is an automatic counter, the calculation box model is display:list-item; style, counter-reset: counter-name; resets your counter name, the definition is valid in body, counter-increament: counter-name; indicates that the defined counter is self-incrementing, and then defines the content: "Note" counter (note-counter, upper-roman) of the pseudo element:: before or:: after: " defines the display content and format of the list item tag. demo

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1eab9e0-47e2f.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1eab9e0-47e2f.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?