page-break-inside-001

page-break-inside: avoid (basic)

WeasyPrint

This browser

Flags
paged
Assertion
The 'avoid' value of the 'page-break-inside' property causes the UA to avoid breaking inside the element.

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-inside: avoid (basic)</title>
 5 <link rel="author" title="Tom Clancy" href="mailto:tclancy@revenution.com">
 6 <link rel="help" href="http://www.w3.org/TR/CSS21/page.html#page-break-props">
 7 <link rel="help" href="http://www.w3.org/TR/css3-page/#pg-br-before-after">
 8 <meta name="flags" content="paged">
 9 <meta name="assert" content="The 'avoid' value of the 'page-break-inside' property causes the UA to avoid breaking inside the element.">
10 <style type="text/css">
11 	* {
12 		margin: 0;
13 		padding: 0;
14 		orphans: 1;
15 		widows: 1;
16 	}
17 	html, body {
18 		height:100%;
19 		line-height: 1;
20 	}
21 	div.spacer {
22 		height: 100%;
23         margin-bottom: -2em;
24     }
25 	div#noBreak {
26 		page-break-inside: avoid;
27 		width: 0;
28 	}
29 	
30 </style>
31 </head>
32 <body>
33 	<div class="spacer">This paragraph must be the only content on this page.  The letters a, b, and c are displayed on the next page.</div>
34 	<div id="noBreak">a b c</div>
35 </body>
36 </html>