共用方式為


pageBreakAfter property

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

 

Syntax

Integer value = object.put_pageBreakAfter( v);Integer value = object.get_pageBreakAfter(* sBreak);

Property values

Type: BSTR

always (always)

Always insert a page break after the object.

auto (auto)

Default. Neither force nor forbid a page break after the object.

avoid (avoid)

Internet Explorer 8. Forbid a page break after the object, if possible.

empty string (empty string)

Behaves the same as auto.

inherit (inherit)

Internet Explorer 8. Inherit the value of the same property for the object's parent.

left (left)

Currently behaves the same as always.

right (right)

Currently behaves the same as always.

String format

auto | always | avoid | left | right | inherit

CSS information

Applies To All elements
Media visual
Inherited no
Initial Value auto

Standards information

Remarks

This property applies when printing the document. This property does not apply to the br or hr elements.

If there are conflicts between this property and the IHTMLRuleStyle::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.

Examples

The following example uses the IHTMLRuleStyle::pageBreakAfter property to start printing on a new page.

Setting IHTMLRuleStyle::pageBreakAfter to always for the p element specifies that a page break occurs at the end of each paragraph.

Code example: http://samples.msdn.microsoft.com/workshop/samples/author/dhtml/refs/page-break-after.htm

<!DOCTYPE html>
<html>
<head>
   <style type="text/css">
      P {
         page-break-after: always;
      }
   </style>
</head>
<body>
   <p>Because page-break-after is set to always, there will be a page break after this first paragraph when you print this page.</p>
   <p>This second paragraph prints on the next page.</p>
</body>
</html>

Requirements

Minimum supported client

Windows XP

Minimum supported server

Windows 2000 Server

Header

Mshtml.h

IDL

Mshtml.idl

DLL

Mshtml.dll

See also

Reference

IHTMLStyle6::pageBreakInside

IHTMLRuleStyle::pageBreakBefore

Conceptual

CSS How-to - Optimize Pages for Printing Using CSS