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: margin box referencing document counters</title>
5 <link rel="author" title="Tom Clancy" href="mailto:tclancy@revenution.com">
6 <link rel="author" title="Hewlett-Packard Company" href="http://www.hp.com/">
7 <link rel="help" href="http://www.w3.org/TR/css3-page/#populating-margin-boxes">
8 <meta name="flags" content="paged">
9 <meta name="assert" content="The value of the counter at the beginning of page processing must be used by default. ">
10 <style type="text/css">
11 body {counter-reset: chapter;}
12 div.chapter {counter-increment: chapter;}
13 @page {
14 @top-center { content: "Chapter " counter(chapter); }
15 }
16 div.section {page-break-before: always;}
17 </style>
18 </head>
19 <body>
20 <div class="chapter">This paragaraph should appear on the first page, which should say "Chapter 0" at the top. A second page with "Chapter 4" at the top should also print.</div>
21 <div class="chapter"></div>
22 <div class="chapter"></div>
23
24 <div class="section chapter">This paragaraph should appear on the second page, which should say "Chapter 4" at the top.</div>
25 <div class="chapter"></div>
26 <div class="chapter"></div>
27 </body>
28 </html>