XML technologies / CSS / Advanced websites with CSS / CSS property reference / widows
(Excerpt from “CSS − Advanced websites with Cascading Stylesheets” by Rachel Andrew & Dan Shafer)
The property widows describes the minimum number of lines in a section before which a page break may be inserted. Reserved for the printed version of an HTML page, it prevents isolated lines at the start of a printed page, known as orphans.
Consider a six-line paragraph. If the printed page size requires a break after the fourth line, declaring widows as 3 forces a page break before the paragraph, keeping the last three lines together.
Inherited: yes
See also: orphans
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 last four lines of a paragraph when printing the document:
p {
widows: 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