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

  

 

 

 

back to top