counters-order-001

Order of counters in out-of-flow content

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: Order of counters in out-of-flow content</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   ul { display: block; margin: 0; padding: 0; counter-reset: c; }
12   li { counter-increment: c; }
13   li, div { display: block; margin: 0; padding: 0;
14             width: 3em; border: thin solid; }
15   li:before, div:before { content: counter(c); }
16 
17   #four { border: none; }
18   #four:before { content: none; }
19 
20   #two { float: left; }
21   #three { position: relative; }
22   #four { position: relative; }
23   #four div { position: absolute; left: 8em; }
24   #six { position: absolute; top: 5em; left: 12em; }
25   #eight { position: fixed; top: 8em; left: 4em; }
26 
27   </style>
28  </head>
29  <body>
30 
31  <p>You should see nine boxes below, each just containing a unique
32  multiple of eleven, from 11 to 99, and nothing else.</p>
33 
34  <ul>
35    <li id="one">1</li>
36    <li id="two">2</li>
37    <li id="three">3</li>
38    <li id="four"><div>4</div></li>
39    <li id="five">5</li>
40    <li id="six">6</li>
41    <li id="seven">7</li>
42    <li id="eight">8</li>
43    <li id="nine">9</li>
44  </ul>
45 
46  </body>
47 </html>