CSS widows Property

Beginner
⏱️ 5 min read
📚 Updated: Jun 2026
🎯 4 Examples
Typography & Print

What You’ll Learn

The widows property helps you control how text breaks across pages and columns so stray lines do not appear alone at the top of a new column or page.

01

Top lines

Minimum at break top.

02

Syntax

Positive integers.

03

Default 2

Two lines by default.

04

Columns

Multi-column layouts.

05

Print

Paged media typography.

06

orphans Pair

Bottom-line partner.

Introduction

The widows property in CSS is used to control the minimum number of lines of a block container that must be shown at the top of a page or column.

This property helps in preventing single lines (widows) from appearing at the top of a new page or column, which can improve the readability and visual flow of the text.

Definition and Usage

Think of a “widow” line as a lonely line stranded at the top of a column or page while the rest of the paragraph continued above the break. Setting widows: 3 tells the browser to keep at least three lines together at the top when possible.

Use it in articles, magazines, print stylesheets, and any multi-column text layout where clean breaks matter.

💡
Beginner Tip

Do not confuse widows with orphans. widows protects lines at the top of the next page or column; orphans protects lines at the bottom before the break. Use both together for balanced typography.

📝 Syntax

The syntax for the widows property is simple. It can be applied to any block container element.

syntax.css
element {
  widows: <integer>;
}

Here, the value is a positive integer specifying the minimum number of lines.

Basic Example

widows.css
p {
  widows: 3;
}

Syntax Rules

  • The value must be a non-negative integer such as 2 or 3.
  • It applies to block containers like paragraphs and divs with flowing text.
  • It is most effective when content can break across pages or columns.
  • Pair with orphans for balanced typography at both sides of a break.
  • The property is inherited.

Related Properties

  • orphans — minimum lines at the bottom before a break
  • column-count — creates multi-column layouts where widows matters
  • break-inside — controls whether elements may split across pages
  • line-height — affects how many lines fit in a column or page

🎯 Default Value

The default value of the widows property is 2. This means that by default, at least two lines of a block container must be shown at the top of a page or column when possible.

⚡ Quick Reference

QuestionAnswer
Default value2
Prevent lone top linewidows: 3;
Partner propertyorphans (bottom lines)
Best used inPrint and multi-column text
Value typeNon-negative integer
InheritedYes

💎 Property Values

The widows property accepts a single integer value.

ValueExampleDescription
<integer>widows: 3;A positive integer specifying the minimum number of lines that must appear at the top of a page or column.
2 (default)widows: 2;Browser default — keep at least two lines at the top when possible.
inheritwidows: inherit;Inherits the widows value from the parent element.
2 — default 3 — common choice orphans — bottom-line partner

When to Use widows

widows is helpful whenever text flows across breaks:

  • Print stylesheets — Improve page breaks when users print articles or documentation.
  • Multi-column articles — Avoid a single line sitting alone at the top of a column.
  • Magazine-style layouts — Keep professional typography in long-form content.
  • Documentation PDFs — Pair with orphans for cleaner paged output.
  • News and blog columns — Reduce awkward breaks in responsive column layouts.

👀 Live Preview

Two-column text with widows: 3 and orphans: 3 for cleaner breaks:

When text flows across columns, a single line stranded at the top of a new column is called a widow. The widows property asks the browser to keep at least three lines together at the top when possible.

Good typography avoids awkward breaks that interrupt reading rhythm. Pair widows with orphans so both the bottom and top of each break look balanced.

Examples Gallery

In this example, we’ll ensure that at least three lines of a paragraph are shown at the top of a new page or column.

📜 Core Patterns

Set a minimum number of lines at the top of a page or column break.

Example 1 — Minimum top lines on a paragraph

In this example, we’ll ensure that at least three lines of a paragraph are shown at the top of a new page or column.

index.html
<style>
  p {
    widows: 3;
  }
</style>

<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit...</p>
Try It Yourself

How It Works

widows: 3 sets a minimum of three lines at the top of the next page or column segment when the browser can adjust the break.

Example 2 — Multi-column article layout

Apply widows in a two-column article to reduce lonely lines at column tops.

columns.css
.article {
  column-count: 2;
  widows: 3;
  orphans: 3;
}
Try It Yourself

How It Works

In column layouts, widows prevents a single line from starting a new column when the browser can reflow the break.

🖨 Print & orphans

Use widows in print styles and combine it with orphans.

Example 3 — Print stylesheet

Apply widows inside @media print for cleaner printed page breaks.

print.css
@media print {
  p {
    widows: 3;
    orphans: 3;
  }
}
Try It Yourself

How It Works

Print media is where widows has the most visible effect, because content is paginated into discrete pages.

Example 4 — widows and orphans together

Combine both properties so breaks look balanced at the bottom and top of each column or page.

orphans-widows.css
.story {
  column-count: 2;
  orphans: 3;
  widows: 3;
}
Try It Yourself

How It Works

orphans and widows address opposite sides of the same break, which is why typography guides recommend using both.

♿ Accessibility

  • Readability benefits everyone — Cleaner breaks help low-vision readers and reduce cognitive load when scanning long text.
  • Do not hide content — widows adjusts breaks; it should never remove text from the document.
  • Test print layouts — Verify printed documentation remains readable with sufficient contrast and font size.
  • Screen readers are unaffected — widows is a visual typography property; semantic HTML structure still matters most for assistive tech.

Pair with orphans

widows handles lines at the top of a break. The related orphans property sets the minimum number of lines that must stay at the bottom before the break.

typography-pair.css
article {
  orphans: 3;
  widows: 3;
}

🧠 How widows Works

1

Text flows into columns or pages

Long paragraphs may break across layout regions.

Layout
2

widows sets a minimum top count

The integer value defines how many lines must appear at the top of the continuation.

Rule
3

Browser adjusts the break

When possible, the break moves to avoid a single widow line at the top.

Reflow
=

Balanced typography

Readers see cleaner column and page breaks.

Browser Compatibility

The widows property is supported in most modern browsers, including the latest versions of Chrome, Firefox, Safari, Edge, and Opera. Test your layouts across browsers, especially for print and multi-column use cases.

Modern browsers · Widely supported

Print and column typography

Major browsers support widows for paged and multi-column text, with the strongest results in print preview.

95% Browser support
Google Chrome 25+ · Desktop & Mobile
Full support
Mozilla Firefox All modern versions
Full support
Apple Safari 1.3+ · macOS & iOS
Full support
Microsoft Edge 12+ · All versions
Full support
Opera All modern versions
Full support

Testing tip

Use browser print preview and multi-column layouts to verify widows behavior with your actual content length.

widows property 95% supported

Bottom line: widows is well supported for print and column typography on the modern web.

Conclusion

The widows property is a useful tool for web developers looking to improve the readability and visual flow of text on their web pages.

By ensuring that a minimum number of lines are shown at the top of a page or column, you can avoid awkward breaks and enhance the overall user experience. Experiment with different values to see how this property can benefit your web projects.

💡 Best Practices

✅ Do

  • Pair widows with orphans for balanced breaks
  • Use in print stylesheets and multi-column articles
  • Start with 2 or 3 for most body text
  • Test with real article length, not lorem ipsum alone
  • Combine with sensible line-height for readability

❌ Don’t

  • Confuse widows with orphans
  • Expect visible changes on short single-line paragraphs
  • Set extremely high values that fight natural layout
  • Forget to test print preview for documentation sites

Key Takeaways

Knowledge Unlocked

Five things to remember about widows

Use these points when refining typography at breaks.

5
Core concepts
🕐 02

Default 2

Minimum lines.

Default
🔀 03

orphans

Bottom partner.

Pair
🔒 04

Print

Best use case.

Context
🌐 05

Columns

Multi-column text.

Layout

❓ Frequently Asked Questions

widows sets the minimum number of lines in a block that must appear at the top of a new page, region, or column after a break.
The default value is 2, so at least two lines are kept together at the top unless you change it.
widows controls lines at the top of the next page or column. orphans controls lines left at the bottom before a break.
It is most useful in print layouts and multi-column text where you want to avoid a single lonely line at the top of a column or page.
Yes, widows is inherited. Setting it on a parent affects child block containers unless they override it.

Practice in the Live Editor

Open the HTML editor and test widows in multi-column and print layouts.

HTML Editor →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

5 people found this page helpful