counters-001.html (991B)
1 <!doctype html> 2 <title>CSS Lists and Counters: counters(c, ".", decimal-leading-zero)</title> 3 <link rel="help" href="https://drafts.csswg.org/css-lists/#inheriting-counters"> 4 <link rel="match" href="counters-001-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 body, #test span:first-child { counter-reset: c; } 8 p, #test span { counter-increment: c; } 9 #test span::before { content: counters(c, ".", decimal-leading-zero); } 10 </style> 11 <p>The following two lines should look the same:</p> 12 <div id="test"> 13 <span></span> 14 <span></span> 15 <span></span> 16 <span></span> 17 <span></span> 18 <span></span> 19 <span></span> 20 <span></span> 21 <span></span> 22 <span></span> 23 <span></span> 24 <span></span> 25 <span style="counter-reset: c 98"></span> 26 <span></span> 27 <span></span> 28 </div> 29 <div> 30 01.01 31 02 32 03 33 04 34 05 35 06 36 07 37 08 38 09 39 10 40 11 41 12 42 12.99 43 13 44 14 45 </div>