page-break-before Attribute | pageBreakBefore Property

Sets or retrieves a string indicating whether a page break occurs before the object.

Syntax

HTML { page-break-before : sBreak }
Scripting[ sBreak = ] object.style.pageBreakBefore

Possible Values

sBreakString that specifies or receives one of the following values.
always
Always insert a page break before the object.
auto
Default. Neither force nor forbid a page break before the object.
avoid New for Windows Internet Explorer 8 
Internet Explorer 8. Forbid a page break before the object, if possible.
empty string
Behaves the same as auto.
inherit New for Internet Explorer 8 
Internet Explorer 8. Inherit the value of the same property for the object's parent.
left
Currently behaves the same as always.
right
Currently behaves the same as always.

The property is read/write for all objects except the following, for which it is read-only: currentStyle. The property has a default value of auto. The Cascading Style Sheets (CSS) attribute is not inherited.

DHTML expressions can be used in place of the preceding value(s). As of Internet Explorer 8, expressions are not supported in IE8 mode. For more information, see About Dynamic Properties.

Remarks

This property applies when printing the document. This property does not apply to the BR or HR elements.

If there are conflicts between the value of this property and the pageBreakAfter property of the object previously displayed in the browser, the value that results in the largest number of page breaks is used.

Page breaks are not permitted inside positioned objects.

Examples

The following examples use the page-break-before attribute and the pageBreakBefore property to start printing on a new page.

This example uses the H3 element as a selector in an embedded style sheet to break the page before all H3 headings.

<html>

<head>
<style type="text/css">
h3 {
	page-break-before: always;
}
</style>
</head>

<body>

<p>
:
</p>
<h3>Start New Section on New Page</h3>

</body>

</html>
This feature requires Microsoft Internet Explorer 4.0 or later. Click the following icon to install the latest version. Then reload this page to view the sample.

This example uses a button to turn off the page break before the object that has an ID value of oPrgrph. When the page is printed or previewed, a page break occurs before the first paragraph unless the user clicks the button.

<html>

<head>
<script type="text/javascript">
function offBreak()
{
    oPrgrph.style.pageBreakBefore="";
}
</script>
</head>

<body>

<button onclick="offBreak()">Turn Off Break</button>
<p id="oPrgrph" style="page-break-before: always">
: 
</p>

</body>

</html>
This feature requires Microsoft Internet Explorer 4.0 or later. Click the following icon to install the latest version. Then reload this page to view the sample.

Standards Information

This property is defined in Cascading Style Sheets (CSS), Level 2 (CSS2) World Wide Web link.

Applies To

ADDRESS, BLOCKQUOTE, BODY, CAPTION, CENTER, currentStyle, DD, DIV, DL, DT, FIELDSET, FORM, hn, ISINDEX, LI, LISTING, MENU, OL, P, PLAINTEXT, PRE, runtimeStyle, style, TABLE, TBODY, TD, TFOOT, TH, THEAD, TR, UL, XMP, CSSCurrentStyleDeclaration Constructor, CSSRuleStyleDeclaration Constructor, CSSStyleDeclaration Constructor

See Also

Tags :


Community Content

pyrobel
page-break-before: right

when you said
left Currently works the same as always.
right Currently works the same as always

is it meaning that ie8 will implement it? for the final release of ie8?

Tags :

Page view tracker