Skip to content

CSS break-inside Property

The break-inside CSS property defines how page, column, or region breaks should behave within the generated box. It is ignored when the generated box is not specified. Valid values include auto, avoid, avoid-page, avoid-column, and avoid-region.

Each element boundary is controlled by three properties:

The CSS fragmentation spec handles break behavior as follows:

  1. Forced breaks (e.g., always, left, right) specified by break-before or break-after take precedence and will occur.
  2. If no forced break is triggered, break-inside determines whether the browser attempts to avoid breaking inside the element. Setting it to avoid prevents page, column, or region breaks within the box.
Initial Valueauto
Applies toblock-level elements.
InheritedNo.
AnimatableDiscrete.
VersionCSS3
DOM Syntaxobject.style.breakInside = "avoid";

Syntax

Syntax of CSS break-inside Property

css
break-inside: auto | avoid | avoid-page | avoid-column | avoid-region | initial | inherit;

Example of the break-inside property:

Example of CSS break-inside Property with avoid value

html
<!DOCTYPE html>
<html>
  <head>
    <title>The title of the document</title>
    <style>
      .multicol {
        background-color: #eee;
        padding: 10px;
        /* Safari and Chrome */
        -webkit-column-count: 3;
        -webkit-column-rule: 2px dotted #ccc;
        /* Firefox */
        -moz-column-count: 3;
        -moz-column-rule: 2px dotted #ccc;
        /* CSS3 */
        column-count: 3;
        column-rule: 2px dotted #ccc;
      }
      .multicol hr {
        break-inside: avoid;
      }
    </style>
  </head>
  <body>
    <div class="multicol">
      <h2>Lorem ipsum</h2>
      <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged.</p>
      <hr />
      <h2>Lorem ipsum</h2>
      <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged.</p>
    </div>
  </body>
</html>

Result

CSS break-inside Property

Values

ValueDescription
autoDefault. Allows normal page, column, or region breaks inside the element.
avoidAvoids any page, column, or region break inside the element.
avoid-pageAvoids a page break inside the element.
avoid-columnAvoids a column break inside the element.
avoid-regionAvoids a region break inside the element.
initialSets the property to its default value (auto).
inheritInherits the property from the parent element.

Practice

What does the CSS 'break-inside' property do?

Dual-run preview — compare with live Symfony routes.