counters-scope-implied-002.xht (1083B)
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: Implied counter scopes by 'counter-increment'</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 <style type="text/css"> 10 11 body { white-space: nowrap; } 12 13 14 .i { counter-increment: c 1; } 15 .ib:before { counter-increment: c 1; content: "B" } 16 .r { counter-reset: c 0; } 17 .u:before { content: counters(c, ".") " "; } 18 19 </style> 20 </head> 21 <body> 22 23 <p>The following two lines should be identical:</p> 24 25 <div><span class="ib"><span class="u"></span><span class="r"><span class="u"></span></span></span><span class="i"><span class="u"></span><span class="r"><span class="u"></span></span></span></div> 26 27 <div>B1 0 1 1.0</div> 28 29 </body> 30 </html>