widows-002

breaks inside elements: orphans - block-level only

WeasyPrint

This browser

Flags
paged
Assertion
The 'widows' property is only applied to block-level elements.

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: breaks inside elements: orphans - block-level only</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#break-inside">
 8 <meta name="flags" content="paged">
 9 <meta name="assert" content="The 'widows' property is only applied to block-level elements.">
10 <style type="text/css">
11 	html, body {
12 		height: 100%;
13 		line-height: 1;
14 		font-size: 20px;
15 	}
16 	* {
17 		margin:0;
18 		padding:0;
19 	}
20 	div.spacer {
21 		height:50%;
22 	}
23 	div.backup {
24 		margin-top:-5em;
25 	}
26 
27 	.test {
28 		color: blue;
29 		width: 1em;
30 		widows: 5;
31 	}
32 	.test span {
33 		widows: 2;
34 	}
35 
36 </style>
37 </head>
38 <body>
39 	<div class="spacer">This test requires 2 pages. The blue text must
40 		denote accurate page numbers. Lines A-B must appear on this page;
41 		lines C-G must appear on the next page.</div>
42 
43 	<div class="spacer backup"></div>
44 	<div class="test"><span>
45 		Page&nbsp;1&nbsp;Line&nbsp;A
46 		Page&nbsp;1&nbsp;Line&nbsp;B
47 		Page&nbsp;2&nbsp;Line&nbsp;C
48 		Page&nbsp;2&nbsp;Line&nbsp;D
49 		Page&nbsp;2&nbsp;Line&nbsp;E
50 		Page&nbsp;2&nbsp;Line&nbsp;F
51 		Page&nbsp;2&nbsp;Line&nbsp;G
52 	</span></div>
53 </body>
54 </html>