B.84. page-break-inside

When printing a Web page, the browser simply places page breaks where they need to occur in the content so that all printed pages are as full as possible by default. This property affords you greater control over the placement of page breaks during printing, by letting you manually prevent page breaks from occurring in the middle of selected elements.

Inherited: Yes

See also: Section B.72orphans, Section B.82page-break-after, Section B.83page-break-before, Section B.125widows

B.84.1. Value

This property can take any of the following values:


avoid

The browser will try to avoid placing a page break within the selected element(s).

The practical effect of this setting is to keep all of an element on one page.


auto

The browser will put a page break within the selected element(s) if the bottom of a page is reached while rendering it.

Initial value: auto

B.84.2. Compatibility

CSS Version: 2

Not supported by any currently-available browser.

B.84.3. Example

This style rule keeps pre elements of class programlisting on one page whenever possible:

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

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.144.230.82