CSS Reference ยท Multi-column and Fragmentation
The orphans property
Reference for the CSS orphans property: set the minimum number of lines of a paragraph left at the bottom of a page or column, with a live column example.
The orphans property sets the minimum number of lines of a block that must stay at the bottom of a page, column or other fragment before a break. If a paragraph would leave fewer lines than that, the browser moves the whole paragraph (or enough lines) to the next fragment.
An "orphan" in typography is a short stub of a paragraph, often a single line, stranded at the bottom of a column. Its partner, widows, handles stubs at the top of the next one. The property only has an effect where content is fragmented: printing and multi-column layout.
p { orphans: 3; widows: 3; }
Try it
Each column holds five lines. On the left, one line of the orange paragraph (B1) fits under the first paragraph, so it ends up alone at the bottom of the first column. On the right, a paragraph must leave at least three lines there, which is impossible, so the whole orange paragraph moves to the second column.
Syntax
orphans: <integer>;
- Initial value:
2 - Applies to: block containers (paragraphs, divs and similar)
- Inherited: yes
- Animatable: not in any useful way
- Computed value: as specified
Values
| Value | Description |
|---|---|
<integer> |
A positive whole number (1 or more) giving the minimum lines to leave before a break. Zero and negative values are invalid. |
Usage notes
- It counts lines, not words. Narrow containers have more lines per paragraph, so the property matters more in narrow columns.
- The default is already 2. Browsers by default never leave a single line at the bottom. Raise it to 3 or 4 for a more careful print layout, or set it to
1to allow any split. - It needs a break. If a paragraph is not split, the property does nothing. It never forces a break; it only decides where breaks may fall.
- Conflicts with widows. If a paragraph is too short to satisfy both
orphansandwidows, the browser ignores the rules and splits it as needed. Short paragraphs of three lines cannot satisfy 2 + 2. - Inherited. Setting it on
bodyaffects every paragraph. Override it on elements where splits are fine, like code blocks. - Pair with
break-inside: avoid. To keep a small paragraph whole,break-inside: avoidis stronger and clearer.
Browser support
Supported in Chromium-based browsers and Safari; check a compatibility table for the current status in Firefox, which has been slower to support the fragmentation properties.
Related
widowsโ lines at the top of the next fragmentbreak-insideโ keep a box wholebreak-beforeandbreak-after- Lesson: Print Styles, Multi-column Layout