CSS break-inside Property


Example

Avoid a page-break inside an <img> element: 

@media print {
  img {
    display: block;
    break-inside: avoid;
  }
}


Definition and Usage

The break-inside property specifies whether or not a page break, column break, or region break should occur inside the specified element.

The break-inside property extends then CSS2 page-break-inside property.

With break-inside, you can tell the browser to avoid breaks inside images, code snippets, tables, and lists.

Default value: auto
Inherited: no
Animatable: no. Read about animatable
Version: CSS3
JavaScript syntax: object.style.breakInside="always"

Browser Support

The numbers in the table specify the first browser version that fully supports the property.

Property
break-inside 50.0 10.0 65.0 10.0 37.0


CSS Syntax

break-inside: auto|all|always|avoid|avoid-column|avoid-page|avoid-region|column|left|page|recto|region|right|verso|initial|inherit;

Property Values

Value Description
auto Default. Automatic page/column/region break inside the element
avoid Avoid a page/column/region break inside the element
avoid-column Avoid a column-break inside the element
avoid-page Avoid a page-break inside the element
avoid-region Avoid a region-break inside the element
initial Sets this property to its default value. Read about initial
inherit Inherits this property from its parent element. Read about inherit

More Examples

Example

Avoid a page-break inside a <table>, <ul>, <ol> elements:: 

@media print {
  table, ul, ol {
    break-inside: avoid;
  }
}


Copyright 1999-2023 by Refsnes Data. All Rights Reserved.