- Services
- Case Studies
- Technologies
- NextJs development
- Flutter development
- NodeJs development
- ReactJs development
- About
- Contact
- Tools
- Blogs
- FAQ
CSS Break-Before Control Page, Column, and Region Breaks
Use it to manage layouts and enhance readability with options like auto, avoid, always, and more.
CSS break-before
Property
The CSS break-before
property controls how page, column, or region breaks occur before an element. It’s useful for web design, allowing precise management of layout and content flow.
Syntax
Values
Generic Break Values
auto
: Allows breaks naturally.avoid
: Prevents breaks.always
: Forces a break (page, column, or region).all
: Forces a break through all fragmentation contexts.
Page Break Values
avoid-page
: Prevents page breaks.page
: Forces a page break.left
: Starts next page on the left.right
: Starts next page on the right.recto
: Starts next page on the right in a left-to-right layout.verso
: Starts next page on the left in a left-to-right layout.
Column Break Values
avoid-column
: Prevents column breaks.column
: Forces a column break.
Region Break Values
avoid-region
: Prevents region breaks.region
: Forces a region break.
Global Values
inherit
: Uses the value from the parent element.initial
: Sets the default value.revert
: Resets to the browser default.revert-layer
: Resets to the UA style sheet.unset
: Resets to the natural value.
Page Break Aliases
For backward compatibility, page-break-before
is treated as an alias for break-before
:
page-break-before | break-before |
---|---|
auto | auto |
left | left |
right | right |
avoid | avoid |
always | page |
Examples
Breaking into Neat Columns
In this example, we use break-before: column
to ensure each <h2>
heading starts at the top of a new column, making the content well-organized and easy to read.
HTML
CSS
Forcing a Page Break
In this example, we use break-before: page
to force a page break before a specific heading. This is useful for print media or generating PDFs where you want to ensure that certain sections start on a new page.
HTML
CSS
Browser Compatibility
The break-before
property is well-supported across modern web browsers, ensuring consistent layout control for web developers. However, some older browsers may have limited support. For the most up-to-date information, check resources like Can I use or the MDN Web Docs Browser Compatibility Data.
Understanding browser compatibility helps ensure your layouts work consistently across different platforms. Always test your web pages in multiple browsers to catch any issues early.
Talk with CEO
We'll be right here with you every step of the way.
We'll be here, prepared to commence this promising collaboration.
Whether you're curious about features, warranties, or shopping policies, we provide comprehensive answers to assist you.