CSS Attributes Index Printing Attributes
Sets or retrieves whether a page break occurs before the object and on which page ( left or right ) the subsequent content should resume.
CSS |
{ page-break-before: 'auto' | 'always' | 'left' | 'right' } |
Script |
object.style.pageBreakBefore = sBreak ] |
auto |
Insert a page break before the object only if necessary. |
always |
Always insert a page break before the object. |
left |
Insert one or two page breaks before the object until a blank left page is reached. |
right |
Insert one or two page breaks before the object until a blank right page is reached. |
The property is read/write with a default value of auto; the CSS attribute is not inherited.
This property applies when printing the document.
If there are conflicts between this property and the pageBreakAfter value on the next object ( as formatted on the canvas ), the value that results in the largest number of page breaks will be used.
Page breaks are not permitted inside positioned objects.
The following examples demonstrate use of inline event handlers to dynamically specify whether to start printing on a new page. Both methods yield the same effect.
The sample below uses H3 as a selector in an embedded stylesheet to break the page before all H3 headings.
<style>
H3 { page-break-before: always }
</style>
. . .
<body>
<H3>Start New Section on New Page</H3>
This feature requires Microsoft® Internet Explorer® 4.0 or later.
Show me
The sample below uses a call to a function to turn off the page break before the object having an id value of "idParagraph". When the page is printed, there is a page break before the first paragraph unless the "Turn off break" button was clicked.
<script language="JavaScript">
function offBreak ( ) {
idParagraph.style.pageBreakBefore="";
}
</script>
</head>
<body>
<button onClick="offBreak ( )">
Turn off break</button>
<P id="Paragraph" STYLE="page-break-before='always'">
...
</p>
This feature requires Microsoft® Internet Explorer® 4.0 or later.
Show me