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 1 Line A</p>
41 <p>Page 1 Line B
42 Page 1 Line C
43 Page 2 Line D</p>
44
45 <div class="spacer start"></div><div class="spacer backup"></div>
46 <p class="avoidAfter">Page 3 Line E
47 Page 3 Line F
48 Page 4 Line G</p>
49 <p>Page 4 Line H</p>
50
51 <div class="spacer start">[page 5]</div><div class="spacer backup"></div>
52 <p class="avoidInside avoidAfter">Page 6 Line I
53 Page 6 Line J
54 Page 6 Line K</p>
55 <p>Page 6 Line L</p>
56 </body>
57 </html>