page-selectors-001.xht (1188B)
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: 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>