page-break-after-009

page-break-after: avoid

WeasyPrint

This browser

Flags
paged
Assertion
The 'avoid' value of the 'page-break-after' property inhibits a page break after the element when possible.

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-break-after: avoid</title>
 5 <link rel="author" title="Elika J. Etemad" href="http://fantasai.inkedblade.net/contact">
 6 <link rel="author" title="Tom Clancy" href="mailto:tclancy@revenution.com">
 7 <link rel="help" href="http://www.w3.org/TR/CSS21/page.html#page-break-props">
 8 <link rel="help" href="http://www.w3.org/TR/css3-page/#pg-br-before-after">
 9 <meta name="assert" content="The 'avoid' value of the 'page-break-after' property inhibits a page break after the element when possible.">
10 <meta name="flags" content="paged">
11 <style type="text/css">
12 	html, body { height: 100%; line-height: 1; font-size: 20px; margin: 0; padding: 0; }
13 	.spacer { height: 50%; }
14 	.backup { margin-top: -3em; }
15 	.start { page-break-before: always; }
16 
17 	p {
18 		margin: 0;
19 		color: blue;
20 		orphans: 1;
21 		widows: 1;
22 		white-space: pre;
23 	}
24 
25 	.avoidAfter {
26 		page-break-after: avoid;
27 	}
28 	.avoidInside {
29 		page-break-inside: avoid;
30 		widows: 3;
31 		orphans: 3;
32 	}
33 </style>
34 </head>
35 <body>
36 	<div class="spacer">
37 		Lines A-L must appear on the 6 pages of this test. The blue text
38 		must accurately describe the page numbers.
39 	</div><div class="spacer backup"></div>
40 	<p class="avoidAfter">Page&nbsp;1&nbsp;Line&nbsp;A</p>
41 	<p>Page&nbsp;1&nbsp;Line&nbsp;B
42 Page&nbsp;1&nbsp;Line&nbsp;C
43 Page&nbsp;2&nbsp;Line&nbsp;D</p>
44 
45 	<div class="spacer start"></div><div class="spacer backup"></div>
46 	<p class="avoidAfter">Page&nbsp;3&nbsp;Line&nbsp;E
47 Page&nbsp;3&nbsp;Line&nbsp;F
48 Page&nbsp;4&nbsp;Line&nbsp;G</p>
49 	<p>Page&nbsp;4&nbsp;Line&nbsp;H</p>
50 
51 	<div class="spacer start">[page 5]</div><div class="spacer backup"></div>
52 	<p class="avoidInside avoidAfter">Page&nbsp;6&nbsp;Line&nbsp;I
53 Page&nbsp;6&nbsp;Line&nbsp;J
54 Page&nbsp;6&nbsp;Line&nbsp;K</p>
55 	<p>Page&nbsp;6&nbsp;Line&nbsp;L</p>
56 </body>
57 </html>