English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

CSS reference manual

CSS @rules

CSS attribute大全

CSS page-break-Usage and examples of inside attribute

page-break-The inside CSS attribute forces or prohibits pagination symbols inside elements. This attribute applies to generating boxes.Block-levelElement. It does not apply to empty <p>, and does not generate a blank box.

The following table provides usage instructions and version history of this attribute, as well as its syntax in JavaScript scripts.

Default value:auto
Applies to:Block-level elements
Inheritance:None
Animatable:No.Please see Animation properties.
Version:CSS 2,3

page-break-The syntax of inside

The syntax of this attribute is as follows:

page-break-inside: auto | avoid | initial | inherit

The following example demonstrates how to use page-break-inside attribute.

  @media print {
   ul {
    page-break-inside: avoid;      
   }
  }
Test to see‹/›

The style rules in the above example set the pagination behavior to avoid splitting the unordered list into two pages.

Note:this page-break-The inside attribute is only applicable to root elements ortable-rowin the normal flow of theBlock-levelElement.

Attribute value

The following table describes the values of this attribute.

ValueDescription
autoIf necessary, insert a pagination symbol inside the element. This is the default value.
avoidAvoid pagination inside elements.
initialSet this attribute to its default value.
inheritIf specified, the associated elements will use their parent element's page.-break-inside attribute values.

Browser compatibility

page-break-insideFirefox does not support this attribute.

  • Firefox (none)

  • Google Chrome1+

  • Internet Explorer 8+

  • Apple Safari 1.3+

  • Opera 7+

Warning:Avoid using this attribute as it is not well supported. Also, use pagination symbols as little as possible and avoid pagination inside table elements with borders, floating elements, and block elements.

Read more

Please refer to the following tutorials:CSS Media Types.

Related attributes:page-break-after,page-break-before.