counters-scope-004

Counter scope and nesting

WeasyPrint

This browser

Source

 1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
 2 <html>
 3  <head>
 4   <title>CSS Test: Counter scope and nesting</title>
 5   <link rel="author" title="L. David Baron" href="http://dbaron.org/">
 6   <link rel="help" href="http://www.w3.org/TR/CSS21/generate.html#scope">
 7   <link rel="help" href="http://www.w3.org/TR/CSS21/generate.html#counters">
 8   <link rel="help" href="http://www.w3.org/TR/CSS21/generate.html#propdef-content">
 9   <link rel="help" href="http://www.w3.org/TR/CSS21/syndata.html#counter">
10   <style type="text/css">
11 
12   body { white-space: nowrap; }
13 
14 
15   .reset { counter-reset: c; }
16   .rb:before { counter-reset: c; content: "R"; }
17   .use { counter-increment: c; }
18   .use:before { content: counters(c, ".") " "; }
19 
20   </style>
21  </head>
22  <body>
23 
24  <p>The next two lines should be the same:</p>
25 
26  <div><span class="reset"></span><span class="use"></span><span class="reset"></span><span class="use"></span><span class="rb"><span class="use"></span><span class="reset"></span><span class="use"></span></span></div>
27  <div>1 1 R1.1 1.1</div>
28 
29  </body>
30 </html>