page-break-after Attribute | pageBreakAfter Property

MS Office DHTML, HTML & CSS

page-break-after Attribute | pageBreakAfter Property


Sets or retrieves whether a page break occurs after the object.

Syntax

HTML{ page-break-after: sBreak }
Scriptingobject.style.pageBreakAfter [ = sBreak ]

Possible Values

sBreak String that specifies one of the following values:
alwaysAlways insert a page break after the object.
autoNeither force nor forbid a page break after the object.
""Empty string does not insert a page break.

The property is read/write with a default value of auto; the cascading style sheets (CSS) attribute is not inherited.

Expressions can be used in place of the preceding value(s), as of Microsoft® Internet Explorer 5. For more information, see dynamic propertiesInternet Link.

Remarks

This property applies when printing the document.

If there are conflicts between this property and the pageBreakBefore value on 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.

Example

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

This example uses the P element as a selector in an embedded style sheet to break the page at the end of all paragraphs.

Sample Code

<STYLE>
    P { page-break-after: always }
</STYLE>
</HEAD>
<BODY> 
<P>
:
</P>

This feature requires Internet Explorer 4.0 or later. Click the icon below to install the latest version. Then reload this page to view the sample.
Microsoft Internet Explorer

This example uses a call to a function to turn off the page break after the object that has an id value of idParagraph.

<SCRIPT>
function offBreak()
{
    idParagraph.style.pageBreakAfter="";
}
</SCRIPT>
</HEAD>
<BODY>
<BUTTON onClick="offBreak()">Turn off break</BUTTON>

This feature requires Internet Explorer 4.0 or later. Click the icon below to install the latest version. Then reload this page to view the sample.
Microsoft Internet Explorer

Applies To

[ Object Name ]
PlatformVersion
Win16:
Win32:
Mac:
Unix:
WinCE:
Version data is listed when the mouse hovers over a link, or the link has focus.
BLOCKQUOTE, BODY, BUTTON, CENTER, currentStyle, DD, DIR, DIV, DL, DT, FIELDSET, FORM, Hn, ISINDEX, LI, LISTING, MARQUEE, MENU, OL, P, PLAINTEXT, PRE, runtimeStyle, style, TABLE, TD, TR, UL, XMP

Back to topBack to top

Did you find this topic useful? Suggestions for other topics? write us!Internet Link

© 1999 microsoft corporation. all rights reserved. terms of useInternet Link.