counters-multi-001

Multiple increments and resets

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: Multiple increments and resets</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 
14   body { counter-reset: one 7 two -2; }
15   #one:before { counter-increment: one -6; content: counter(one) }
16   #two:before { counter-increment: dummy two 7 two two -4 silly 7; content: counter(two) }
17 
18   </style>
19  </head>
20  <body>
21 
22  <p>The following should be identical:</p>
23 
24  <div><span id="one"></span><span id="two"></span></div>
25  <div>12</div>
26 
27  </body>
28 </html>