Name
page-break-after, page-break-before — NN n/a IE 4 CSS 2
Synopsis
Inherited: No
Defines how content should treat a page break around an element when the document is sent to a printer. Page breaks are not rendered in the visual browser as they may be in word processing programs; on screen, long content flows in one continuous scroll.
Page breaks (and related attributes such as widows
and orphans
) are handled more fully in CSS2 than
as deployed in Internet Explorer 4. Proper handling of pages for
printers relies on the CSS2 concept of the page
box, which is a rectangular region that ultimately reaches
a printed page. Page break style attributes help the browser control
the precise content of each page box. Without any assistance (or with
the auto
setting), the browser divides pages for
printing much as it has in the past by doing a best-fit for the
content to fill up as much of each page as there is space for it.
To force a page break above an element, associate a
page-break-before:always
style setting with the
element. Similarly, to force a break after an element, use
page-break-after:always
. For example, if you want
a special class of BR
elements to break after
them, you could set up a class selector style rule as follows:
<STYLE TYPE="text/css"> BR.pageEnd {page-break-after: always} </STYLE>
Then, whenever you want to force a page break in the document, include the following tag:
<BR CLASS="pageEnd">
Attribute settings for left
and
right
assume that the browser is equipped to detect ...
Get Dynamic HTML: The Definitive Reference now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.