Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

HTML DOM Style orphans Property

Style orphans Property

Style Object Reference The Style object


Definition and Usage

The orphans property sets or returns the minimum number of visible lines an element must have at the bottom of a page (for printing or print preview).

The orphans property only affects block-level elements.

**Tip:** orphans:5 means that at least 5 lines must be visible above the page break.

**Tip:** The widows property sets or returns the minimum number of visible lines an element must have at the top of a page.

Syntax

Set the orphans property:

Object.style.orphans="

number

|inherit"

Return the orphans property:

Object.style.orphans

Value Description
number An integer specifying the minimum number of visible lines. The default value is 2.
inherit The value of the orphans property is inherited from the parent element.

Browser support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

Only Opera supports the orphans property.


Example

Example

Change the orphans property for printing or print preview:

Runoob Tutorial(runoob.com)

Modify the orphans property for printing or print preview.

Line 2

Line 3

Line 4

Line 5

Line 6

Line 7

Line 8

    

Try it »


Style Object Reference The Style object