counters-root-000

counters on the root element

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: counters on the root element</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#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   <style type="text/css">
10 
11   body { white-space: nowrap; }
12 
13   html { counter-reset: c 0 c 4 c 0; counter-increment: c 1 c 3; }
14   html:before { content: " "; counter-reset: c 9999; counter-increment: c 9999; }
15   body { counter-reset: c 3; counter-increment: c 5; }
16 
17   span.c:before { content: counters(c, "."); }
18 
19   </style>
20  </head>
21  <body>
22 
23  <p>The following should be identical:</p>
24 
25  <div>
26    <span class="c"></span>
27  </div>
28 
29  <div>
30    4.8
31  </div>
32 
33  </body>
34 </html>