style.orphans (Property)

Defines the minimum number of lines of a paragraph of text that must be visible at the bottom of a page when a page break is present. This is most likely to occur when printing documents.

Availability:

CSS level - 2
DOM level - 2
JavaScript - 1.5
JScript - 5.0
Internet Explorer - 5.0
Netscape - 6.0
Property/method value type:String primitive
JavaScript syntax:-myStyle.orphans
CSS syntax:orphans: aCount
Argument list:aCountA number of lines for an orphan count

Widows and orphans are fragments of text that appear to be formatted incorrectly when a paragraph of text spans a page break.

Windows and orphans are usually controlled together and the usual technique is to specify that an entire paragraph should be kept on the same page. This forces the paragraph to be taken over to the next page in its entirety, even if the flow requires just a single word to be taken over.

The CSS styling controls allow a finer level of control in that you can allow for a paragraph to be split across a page boundary, but specify a lower limit on the number of lines that must be kept on a single page.

This is fine in principle, but there can be some contention for the right layout when a very short paragraph is spanning a page break. This will generally be solved simply by forcing the page break to happen before the paragraph causing the whole paragraph to be carried over to the next page.

An orphan is that fragment of text that is left at the bottom of a page when a paragraph encloses a page break. It is the topmost few lines of the paragraph. The integer value in this property controls the minimum number of lines that must be present, otherwise the paragraph will be taken over entirely to the next page.

See also:style.pageBreakAfter, style.size, style.widows