allowed-page-breaks-003

allowed page break - dropping page-break-* restrictions

WeasyPrint

This browser

Flags
paged
Assertion
If the standard restrictions do not provide enough break points to keep content from overflowing the page boxes, then the restrictions imposed by 'avoid' on the 'page-break-*' properties are dropped.

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: allowed page break - dropping page-break-* restrictions</title>
 5 <link rel="author" title="Tom Clancy" href="mailto:tclancy@revenution.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#page-break-props">
 8 <meta name="assert" content="If the standard restrictions do not provide enough break points to keep content from overflowing the page boxes, then the restrictions imposed by 'avoid' on the 'page-break-*' properties are dropped.">
 9 <meta name="flags" content="paged">
10 <style type="text/css">
11 	html, body { height: 100%; line-height: 1; font-size: 20px; margin: 0; padding: 0; }
12 	div.spacer {
13 		height: 25%;
14 	}
15 	div.backup {
16 		margin-top: -3em;
17 	}
18 
19 	div#wrapper {
20 		height: 200%;
21 		page-break-inside: avoid;
22 		widows: 3;
23 		orphans: 3;
24 	}
25 	
26 	p {
27 		margin: 0;
28 		color: blue;
29 	}
30 	p, #wrapper div {
31 		page-break-before: avoid;
32 		page-break-after: avoid;
33 	}
34 </style>
35 </head>
36 <body>
37 	<div id="wrapper">
38 		<div class="spacer">This test requires two pages. Lines D-F must be on the second.</div>
39 		<div class="spacer backup"></div>
40 		<p>Page&nbsp;1&nbsp;Line&nbsp;A</p>
41 		<p>Page&nbsp;1&nbsp;Line&nbsp;B</p>
42 		<p>Page&nbsp;1&nbsp;Line&nbsp;C</p>
43 		<p>Page&nbsp;2&nbsp;Line&nbsp;D</p>
44 		<p>Page&nbsp;2&nbsp;Line&nbsp;E</p>
45 		<p>Page&nbsp;2&nbsp;Line&nbsp;F</p>
46 	</div>
47 </body>
48 </html>