HTML and CSS Reference
In-Depth Information
If you wanted to increase the size of widows and orphans to three lines for the para-
graphs in a document, you could apply the style rule
p {
widow: 3;
orphan: 3;
}
and printers would not insert a page break if fewer than three lines of a paragraph would
be stranded at either the top or the bottom of the page.
How Browsers Set Automatic Page Breaks
Browsers establish page breaks automatically unless you manually specify the page
breaks with CSS. By default, browsers insert page breaks using the following guidelines:
• Insert all of the manual page breaks as indicated by the page-break-before ,
page-break-after , and page-break-inside properties.
• Break the pages as few times as possible.
• Make all pages that don't have a forced page break appear to have the same height.
• Avoid page breaking inside a grouping element that has a border.
• Avoid breaking inside a table.
• Avoid breaking inside of a floating element.
Only after attempting to satisfy these constraints are the Web page designer's recom-
mendations for the widow and orphan styles applied.
You can combine all of the page styles described above to provide the greatest
control over the appearance of your printed document. The following styles display
all blockquote elements on an 8.5-
3
-11 inch sheet on a single page in landscape
orientation:
@page quote_page {
8.5in 11in landscape;
}
blockquote {
page: quote_page;
page-break-before: always;
page-break-inside: avoid;
page-break-after: always;
}
Search WWH ::




Custom Search