Layout
break-before
break-before sets whether a column or page break happens just before an element. With column, the element starts at the top of the next column.
Syntax
auto | avoid | always | all | avoid-page | page | left | right | recto | verso | avoid-column | column | avoid-region | regionPreview
The fox.茶色の狐が跳ぶ。Over the lazy dog.
Presets
Drag the bottom-right corner to resize
Code
.box {
column-count: 2;
column-fill: auto;
}
.box > :nth-child(2) {
break-before: column;
}Controls
break-beforecolumn
The fox.茶色の狐が跳ぶ。Over the lazy dog.
About
What the values mean
auto: the initial value. A break happens only when the content no longer fits.column: always starts a new column before the element.avoid: avoids both column and page breaks before the element when possible.avoid-column: avoids a column break before the element when possible.page/avoid-page: when printing, always starts / avoids starting a new page before the element.left/right: when printing, starts a new page so that the next one is a left / right page. A blank page may be inserted to get there.recto/verso: starts on the front / back side of a leaf. In a book that pages from left to right, these are the same asright/left.always: starts a new column inside columns, or a new page otherwise. It only works when printing from Firefox.
The preview sets it on the light blue block (the second child) inside a two-column box. The box also has column-fill: auto, so the first column fills up first. With auto everything fits in the first column. With column the block starts at the top of the second column.
When to use it
It is common in print styles: put break-before: page on chapter headings so that every chapter starts on a new page.
Watch out
- Inside columns,
column,avoid, andavoid-columnonly work in Chrome and Edge. Firefox and Safari do not start a new column. - It has no effect on inline-level elements (a
span, or an element withdisplay: inline-block). Use it on block elements such asdisplay: block. - The previous element's
break-afterand this element'sbreak-beforeapply to the same break point. If either one forces a break, such ascolumnorpage, the break happens even if the other isavoid. - The old
page-break-beforestill works as an alias ofbreak-before(itsalwaysmeanspage). all,region, andavoid-regionare not supported by any browser, so they are left out of the controls.