XML technologies / CSS / Advanced websites with CSS / CSS property reference / orphans
(Excerpt from “CSS − Advanced websites with Cascading Stylesheets” by Rachel Andrew & Dan Shafer)
The property orphans describes the minimum number of lines in a section after which a page break may be inserted. This property applies only to printed HTML elements and prevents isolated lines at the end of a printed page, known as widows.
Consider a six-line paragraph. If the printed page size requires a break after the second line, declaring orphan as 3 forces a page break before the paragraph, keeping the first three lines together.
Inherited: yes
See also: widows
Values
A positive integer.
Default value: 2
Compatibility
CSS version: 2
Works in all Mozilla-based browsers (including Netscape 6 and later), Opera 7 and Internet Explorer 5 for Macintosh.
Example
The following rule prevents a page break within the first four lines of a paragraph when printing:
p {
orphans: 4;
}
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