page-breaks-101

Page Breaks and Bottom Margin (with bg/border)

WeasyPrint

This browser

Flags
paged
Assertion
Page breaks are not allowed between the last child of a block and its parent.

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 Breaks and Bottom Margin (with bg/border)</title>
 5   <link rel="author" title="Melinda Grant" href="mailto:melinda.grant@hp.com">
 6   <link rel="author" title="Elika J. Etemad" href="http://fantasai.inkedblade.net/contact">
 7   <link rel="help" href="http://www.w3.org/TR/CSS21/page.html#allowed-page-breaks">
 8   <link rel="help" href="http://www.w3.org/TR/css3-page/#allowed-pg-brk">
 9   <meta name="flags" content="paged">
10   <meta name="assert" content="Page breaks are not allowed between the last child of a block and its parent.">
11   <style type="text/css">
12 
13     div {
14         background: #eee;
15         border: thick solid orange;
16     }
17     p {
18         margin-bottom: 15in;
19         white-space: nowrap;
20         color: blue;
21     }
22 
23   </style>
24  </head>
25  <body>
26    <div>
27    This test produces multiple pages on paged media. The words
28    SECOND PAGE TOP below must appear at the top of the second page.
29      <p>
30      SECOND PAGE TOP
31      </p>
32    </div>
33  </body>
34 </html>