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;
}

  

 

 

 

back to top