XML technologies / CSS / Advanced websites with CSS / CSS property reference / page-break-before
(Excerpt from “CSS − Advanced websites with Cascading Stylesheets” by Rachel Andrew & Dan Shafer)
The property page-break-before can insert or suppress a page break before an element in the printed version of a page.
Inherited: no
See also: orphans, page-break-after, page-break-inside, widows
Values
The property accepts one of the following constants:
always: A page break is always inserted before the element.avoid: A page break before the element is avoided. This setting ensures that the element is never separated from the preceding element in the printed version of a page.auto: The browser inserts a page break before the element when appropriate in the printed version.left: The browser inserts enough page breaks before the element to make it start at the top of a left-hand page in double-sided printing.right: The browser inserts enough page breaks before the element to make it start at the top of a right-hand page in double-sided printing.
Default value: auto
Compatibility
CSS version: 2
Works in Internet Explorer 4 and later, Netscape 7 and later, Mozilla and Opera. All browsers treat left and right as always.
The value avoid is not correctly supported by Internet Explorer for Windows. To achieve the corresponding effect, use JavaScript to set the property to an empty string ("").
Example
The following style rule inserts enough page breaks before all sections div of the class kapitelanfang to make them appear at the top of a right-hand page in the printed version:
div. kapitelanfang{
page-break-before: right;
}
Copyright © 2006 of the German translation, dpunkt.verlag GmbH
You may print the online version for your private use.
Otherwise, this chapter from “CSS − Anspruchsvolle Websites mit Cascading Stylesheets” is subject to the same conditions as the bound edition: the work, including all its parts, is protected by copyright. All rights reserved, including reproduction, translation, microfilming, and storage and processing in electronic systems.
dpunkt.verlag GmbH, Ringstraße 19, 69115 Heidelberg