widows and orphans

Back to the index.

When a block of text, such as a paragraph, is laid out over more than one print page or column, it may occur that there’s only one or two lines just before or after the page or column break.

Orphans are lines before the break, on the old page or columns; widows lines after the break, on the new page or column.

Usually you want at least three or four lines before or after a break. The widows and orphans declarations allow you to set such minimums.

Reference

This text is split into three columns. The middle one has a border. No other instructions are given.

Line 1
Line 2
Line 3
Line 4
Line 5
Line 6
Line 7
Line 8
Line 9

Line 1
Line 2
Line 3
Line 4
Line 5

Line 6
Line 7
Line 8
Line 9
Line 10
Line 11
Line 12
Line 13
Line 14
Line 15
Line 16
Line 17
Line 18
Line 19

Line 1
Line 2
Line 3
Line 4
Line 5
Line 6
Line 7
Line 8
Line 9

With widows

Here we add the following CSS. The “widow block,” the lines that should be in one column, are red.

p.test {
	widows: 5;
}

Line 1
Line 2
Line 3
Line 4
Line 5
Line 6
Line 7
Line 8
Line 9

Line 1
Line 2
Line 3
Line 4
Line 5

Line 6
Line 7
Line 8
Line 9
Line 10
Line 11
Line 12
Line 13
Line 14
Line 15
Line 16
Line 17
Line 18
Line 19

Line 1
Line 2
Line 3
Line 4
Line 5
Line 6
Line 7
Line 8
Line 9

With orphans

Here we add the following CSS. The “orphan block,” the lines that should be in one column, are red.

p.test {
	orphans: 5;
}

Line 1
Line 2
Line 3
Line 4
Line 5
Line 6
Line 7
Line 8
Line 9

Line 1
Line 2
Line 3
Line 4
Line 5

Line 6
Line 7
Line 8
Line 9
Line 10
Line 11
Line 12
Line 13
Line 14
Line 15
Line 16
Line 17
Line 18
Line 19

Line 1
Line 2
Line 3
Line 4
Line 5
Line 6
Line 7
Line 8
Line 9

With both

And here we try both widows and orphans.

Line 1
Line 2
Line 3
Line 4
Line 5
Line 6
Line 7
Line 8
Line 9

Line 1
Line 2
Line 3
Line 4
Line 5

Line 6
Line 7
Line 8
Line 9
Line 10
Line 11
Line 12
Line 13
Line 14
Line 15
Line 16
Line 17
Line 18
Line 19

Line 1
Line 2
Line 3
Line 4
Line 5
Line 6
Line 7
Line 8
Line 9