CSS widows Attribute

Definition and Usage

widows The attribute specifies the minimum number of lines that must be retained at the top of the page or column.

Tip:See also orphans property.

Example

When printing, at least 4 lines are displayed at the bottom of each page and at least 2 lines at the top:

@media print {
  orphans: 4;
  widows: 2;
}

CSS Syntax

widows: integer|initial|inherit;

Attribute Value

Value Description
integer

Specifies the minimum number of lines that must be retained at the top of the page or column.

Negative values are not allowed.

initial Sets this property to its default value. See initial.
inherit Inherits this property from its parent element. See inherit.

Technical Details

Default Value: 2
Inheritance: yes
Animation Creation: Not supported. See:Animation-related Properties.
Version: CSS3
JavaScript Syntax: object.style.widows = "3"

Browser Support

The numbers in the table indicate the browser version that first fully supports this property.

Chrome Edge Firefox Safari Opera
25.0 8.0 Not Supported 7.0 10.0