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