page-break-inside-005.xht (1470B)
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" 2 "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> 3 <html xmlns="http://www.w3.org/1999/xhtml"> 4 <head> 5 <title>CSS Test: page-break-inside inheritance</title> 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/text.html#spacing-props"/> 8 <meta name="flags" content="paged"/> 9 <meta name="assert" content="'page-break-inside' does not inherit."/> 10 <style type="text/css"> 11 /* Most permissible breaking possible */ 12 * { widows: 1; orphans: 1; widows: 0; orphans: 0; } 13 14 /* Leave 2.5 lines at bottom to play with, independent of page size. */ 15 html, body { 16 height: 100%; 17 margin: 0; 18 line-height: 1; 19 } 20 .spacer1 { 21 height: 35%; 22 } 23 .spacer2 { 24 height: 15%; 25 margin-top: -2.5em; 26 } 27 28 .avoid { 29 page-break-inside: avoid; 30 height: 200%; 31 } 32 .test div { 33 white-space: pre; 34 /* Make test text more visible */ 35 color: blue; 36 font-weight: bold; 37 } 38 </style> 39 </head> 40 <body> 41 <div class="avoid"> 42 <div class="spacer1">This test requires 2 pages. Lines A and B must appear 43 on the first page, lines C and D on the second.</div> 44 <div class="spacer2"></div> 45 <div class="test"> 46 <div> Page 1 Line A 47 Page 1 Line B 48 Page 2 Line C</div> 49 <div> Page 2 Line D</div> 50 </div> 51 </div> 52 </body> 53 </html>