counters-order-000.xht (2144B)
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> 2 <html xmlns="http://www.w3.org/1999/xhtml"> 3 <head> 4 <title>CSS Test: Order of 'counter-reset', 'counter-increment', and counter use, including pseudo-elements</title> 5 <link rel="author" title="L. David Baron" href="https://dbaron.org/"/> 6 <link rel="help" href="http://www.w3.org/TR/CSS21/generate.html#counters"/> 7 <link rel="help" href="http://www.w3.org/TR/CSS21/generate.html#propdef-content"/> 8 <link rel="help" href="http://www.w3.org/TR/CSS21/syndata.html#counter"/> 9 <link rel="match" href="counters-order-000-ref.html" /> 10 <style type="text/css"> 11 12 body { white-space: nowrap; } 13 14 15 span.c span:before { content: counter(c); } 16 span.c { counter-reset: c 0; } 17 span.one { counter-reset: c 1; } 18 span.two { counter-increment: c 2; } 19 span.four:before { counter-reset: c 4; } 20 span.eight:before { counter-increment: c 8; } 21 span.c span:after { counter-increment: c 100; counter-reset: c 200; } 22 23 </style> 24 </head> 25 <body> 26 27 <p>The following should be identical:</p> 28 29 <div> 30 <span class="c"><span class=""></span></span> 31 <span class="c"><span class="one"></span></span> 32 <span class="c"><span class="two"></span></span> 33 <span class="c"><span class="two one"></span></span> 34 <span class="c"><span class="four"></span></span> 35 <span class="c"><span class="four one"></span></span> 36 <span class="c"><span class="four two"></span></span> 37 <span class="c"><span class="four two one"></span></span> 38 <span class="c"><span class="eight"></span></span> 39 <span class="c"><span class="eight one"></span></span> 40 <span class="c"><span class="eight two"></span></span> 41 <span class="c"><span class="eight two one"></span></span> 42 <span class="c"><span class="eight four"></span></span> 43 <span class="c"><span class="eight four one"></span></span> 44 <span class="c"><span class="eight four two"></span></span> 45 <span class="c"><span class="eight four two one"></span></span> 46 </div> 47 48 <div> 49 0 50 1 51 2 52 3 53 4 54 4 55 4 56 4 57 8 58 9 59 10 60 11 61 12 62 12 63 12 64 12 65 </div> 66 67 </body> 68 </html>