counters-scope-002.html (881B)
1 <!doctype html> 2 <title>CSS Lists and Counters: counters scope</title> 3 <link rel="help" href="https://drafts.csswg.org/css-lists/#inheriting-counters"> 4 <link rel="match" href="counters-scope-002-ref.html"> 5 <meta name="assert" content="counters are not inherited from the previous sibling, when can be inherited from the ancestor"> 6 <style type="text/css"> 7 #scope, span#reset { counter-reset: c 0; } 8 span::before { counter-increment: c 1; content: "B" counters(c,".") "-" } 9 span::after { counter-increment: c 1; content: "A" counters(c,".") "-" } 10 </style> 11 <p>The following two lines should be the same:</p> 12 <div id="scope"> 13 <span> 14 <span> 15 <span id="reset"> 16 <span></span> 17 <span></span> 18 </span> 19 <span> 20 <span></span> 21 </span> 22 </span> 23 </span> 24 </div> 25 <div>B1- B2- B2.1- B2.2-A2.3- B2.4-A2.5- A2.6- B3- B4-A5- A6- A7- A8-</div>