asp.net.ph

Skip Navigation Links

page-break-after Attribute | pageBreakAfter Property

CSS Attributes Index   Printing Attributes


Sets or retrieves whether a page break occurs after the object and on which page ( left or right ) the subsequent content should resume.

Syntax


CSS { page-break-after: 'auto' | 'always' | 'left' | 'right' }
Script object.style.pageBreakAfter = sBreak ]

Possible Values


auto Insert a page break after the object only if necessary.
always Always insert a page break after the object.
left Insert one or two page breaks after the object until a blank left page is reached.
right Insert one or two page breaks after 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.

Remarks

If there are conflicts between this property and the pageBreakBefore value on the previous object ( as formatted on the canvas ), the value that results in the largest number of page breaks will be used.

Example

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 P as a selector in an embedded stylesheet to break the page at the end of all paragraphs.

<style>
  P { page-break-after: always}
</style>
. . .
<body> <p>
...
</p>

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 after the object having an id value of "idParagraph".

<script language="JavaScript">
function offBreak ( ) {
idParagraph.style.pageBreakAfter="";
}
</script>
</head>
<body>
<button onClick="offBreak ( )">
  Turn off break</button>

This feature requires Microsoft® Internet Explorer® 4.0 or later.

 Show me 



© 2025 Reynald Nuñez and asp.net.ph. All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note