CSS orphans

View Output Full Screen Preview

The CSS orphans property specifies the minimum number of line boxes in a block container that must be left in a fragment before a fragmentation break.

The orphans property was originally introduced in CSS2 to help authors control line breaks in paged media. CSS3 extends its use to deal with other types of layout features, such as multi-column layouts and CSS Regions (where content from one or more elements can flow through one or more boxes).

The generic term for breaking content across containers is fragmentation. Pages, columns, and regions are referred to as fragmentation containers. They're also referred to as fragmentainers.

Each fragmentation break ends layout of the fragmented box in the current fragmentainer and causes the remaining content to be laid out in the next fragmentainer, in some cases causing a new fragmentainer to be generated to hold the deferred content.

Also see the widows property, which specifies the minimum number of line boxes of a block container that must be left in a fragment after a break.

Syntax

Possible Values

integer

This value specifies the minimum number of line boxes in a block container that must be left in a fragment before a fragmentation break.

This must be a positive integer (zero and non-negative integers are invalid).

In addition, all CSS properties also accept the following CSS-wide keyword values as the sole component of their property value:

initial
Represents the value specified as the property's initial value.
inherit
Represents the computed value of the property on the element's parent.
unset
This value acts as either inherit or initial, depending on whether the property is inherited or not. In other words, it sets all properties to their parent value if they are inheritable or to their initial value if not inheritable.

General Information

Initial Value
2
Applies To
Block containers
Inherited?
Yes
Media
Visual, paged media

Example Code

Official Specifications

Browser Support

Browser support for CSS properties can vary, particularly for newer or experimental features. Check current browser compatibility before using a property in production, especially when supporting older browsers.

The following table provided by Caniuse.com shows the level of browser support for this feature.

Initial Value

CSS properties have an initial value that applies when the property has not been explicitly set. The initial value is different from the value inherited from a parent element and may vary between properties.

Inheritance

Some CSS properties inherit their computed value from their parent element by default, while others do not. The inherit, initial, unset, and revert keywords can also be used to control how a property gets its value.

Vendor Prefixes

Most modern CSS properties use the standard, unprefixed syntax. Vendor-prefixed properties such as -webkit- are mainly relevant to older browser versions or specific features and should only be used when required by your browser support targets.