EN
Il contenuto non è disponibile nella lingua di destinazione, ma solo in inglese.

page-break-before property

Defines whether a page break occurs before the object.

CSS 2.1, Section 13.3.1Internet Explorer 9

 

Syntax

page-break-before: auto | always | avoid | left | right | inherit

Property values

always

Always insert a page break before the object.

auto

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

avoid

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

empty string

Behaves the same as auto.

inherit

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.

CSS information

Applies ToAll elements
Mediavisual
Inheritedno
Initial Valuenone

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 the value of this property and the page-break-after 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 example uses the page-break-before property to start printing on a new page.

Setting page-break-before to always for the h3 element specifies that a page break occurs before each h3 heading.

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



<!DOCTYPE html>
<html>
<head>
   <style type="text/css">
      h3 {
         page-break-before: always;
      }
   </style>
</head>
<body>
   <p>Because page-break-before is set to always, there will be a page break before the following H3 title when you print this page.</p>
   <h3>Start New Section on New Page</h3>
</body>
</html>

See also

CSSStyleDeclaration
currentStyle
runtimeStyle
style
Reference
page-break-inside
page-break-after
Conceptual
CSS How-to - Optimize Pages for Printing Using CSS

 

 

Mostra:
© 2014 Microsoft