page-selectors-001

page selector is optional in @page rules

WeasyPrint

This browser

Flags
paged
Assertion
An @page rule consists of the keyword '@page', followed by an optional page selector, followed by a block of declarations.

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: page selector is optional in @page rules</title>
 5   <link rel="author" title="Melinda Grant" href="mailto:melinda.grant@hp.com">
 6   <link rel="help" href="http://www.w3.org/TR/CSS21/page.html#page-box">
 7   <link rel="help" href="http://www.w3.org/TR/css3-page/#at-page-rule">
 8   <meta name="flags" content="paged">
 9   <meta name="assert" content="An @page rule consists of the keyword '@page', followed by an optional page selector, followed by a block of declarations.">
10   <style type="text/css">
11     @page {
12         margin-top: .5in;
13         margin-bottom: .5in;
14     }
15     @page :first {
16         margin-bottom: 2in;
17         margin-top: 2in;
18     }
19     .break-after {
20         page-break-after: always;
21     }
22   </style>
23  </head>
24  <body>
25    <div>
26      <p class="break-after">
27        This text produces two pages on paged media.
28        This text begins about two inches down from the top of the page.
29      </p>
30      <p>This text begins about one half inch down from the top of the page.</p>
31    </div>
32  </body>
33 </html>