XML technologies / CSS / Advanced websites with CSS / CSS property reference / page-break-inside

(Excerpt from “CSS − Advanced websites with Cascading Stylesheets” by Rachel Andrew & Dan Shafer)

The property page-break-inside can prevent a page break inside an element in the printed version of a page.

Inherited: yes

See also: orphans, page-break-after, page-break-before, widows

Values

The property can take one of the following constants:

  • avoid: Avoids a page break inside the element. This setting prevents an element from being split in the printed version of a page.

  • auto: The browser inserts a page break inside the element when appropriate in the printed version.

Default value: auto

Compatibility

CSS version: 2

Not supported by any current browser.

Example

The following style rule prevents page breaks inside all pre sections of the class sourcecode:

pre.sourcecode {
 page-break-inside: avoid;
}

  

 

 

 

back to top