HTML Guides for print
Learn how to identify and fix common HTML validation errors flagged by the W3C Validator — so your pages are standards-compliant and render correctly across every browser. Also check our Accessibility Guides.
The orphans property only accepts a positive whole number, so a keyword such as auto or none is invalid.
orphans sets the minimum number of lines of a block that must stay at the bottom of a page or column when the browser splits it. The default is 2. The property has no keywords besides the global ones (inherit, initial, unset), so browsers drop a declaration like orphans: auto and keep the value that would apply without it.
The property mostly matters in print styles and multi-column layouts. Its counterpart widows sets the minimum number of lines at the top of the next page or column, and takes the same kind of value.
Replace the keyword with a number such as 2 or 3, or remove the declaration to keep the default. The value must be an integer of at least 1: 0 and decimals such as 1.5 get their own validator errors.
Invalid example
<style>
p {
orphans: auto;
}
</style>
Valid example
<style>
p {
orphans: 3;
}
</style>
The widows property only accepts a positive whole number, so a keyword such as auto or none is invalid.
widows sets the minimum number of lines of a block that must appear at the top of the next page or column when the browser splits the block. The initial value is 2. Apart from the global keywords (inherit, initial, unset), the property takes no keywords, so a declaration like widows: auto is dropped and the element keeps the value it would have without it.
This declaration often arrives with formatted text copied from Safari and pasted into a rich text editor. Safari reports auto as the computed value of both widows and orphans, and the pasted markup carries those computed styles in a long inline style attribute. The same elements then usually trigger the matching orphans error too.
Replace the keyword with a number such as 2 or 3, or remove the declaration to keep the default. In pasted content, deleting both widows and orphans from the style attribute is the simplest fix. The value must be an integer of at least 1: 0 and decimals such as 1.5 get their own validator errors.
Invalid example
<p style="widows: auto;">
A paragraph of text that may break across pages when printed.
</p>
Valid example
<p style="widows: 2;">
A paragraph of text that may break across pages when printed.
</p>
Validate at scale.
Ship accessible websites, faster.
Automated HTML & accessibility validation for large sites. Check thousands of pages against WCAG guidelines and W3C standards in minutes, not days.
1K Weekly
1,000 monthly checks. Cancel anytime.
Get 1K Weekly →Join teams across 40+ countries