Handling Widows and Orphans - HTML

Widows and orphans are normally tragic subjects, but CSS has provided developers an opportunity to reduce their impact. A widow is the number of lines at the top of a page. It can be unsightly if there is, for example, just one sentence at the top of a page before a section break. An orphan is similar, except it occurs at the end of a page. Again, it can be unsightly if a section or paragraph starts at the very end of

This page improves upon the page breaking in Figures.

This page improves upon the page breaking in Figures.

a page and the page break results in only a line or two of text at the very end of the page. One way to help control widows and orphans is through page-breaks. This is especially true since the two CSS properties that are relevant to widows and orphans, respectively named, conveniently enough, widow and orphan, have virtually no browser support beyond Opera.

Both of these properties have similar syntax:

widow: 4; orphan: 3;

You name the property, then supply the value, which can either be an integer or theexplicit value inherit, the latter of which means the element named in the style rule inherits the properties of its parent. The following sets a p element’s widow to a minimum of three lines. This means that the bottom of the page must have a minimum of three lines when printing:

<p STYLE=“orphans: 3”>This paragraph must not be on the top of a page by itself if it doesn’t consist of at least three lines.</p>

If it doesn’t, the entire block must be moved to the next page.

All rights reserved © 2020 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

HTML Topics