首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往

page-break-before

page-break-beforeCSS属性调整分页符之前的当前元素。

此属性适用于生成框的块元素。它不会适用于<div>不会生成框的空白。

/* Keyword values */
page-break-before: auto;
page-break-before: always;
page-break-before: avoid;
page-break-before: left;
page-break-before: right;
page-break-before: recto;
page-break-before: verso;

/* Global values */
page-break-before: inherit;
page-break-before: initial;
page-break-before: unset;

注意:这个属性正在被更通用的取代break-before。这个新的属性也处理列和区域中断,并在语法上兼容page-break-before

在使用之前page-break-before,请检查是否可以使用break-before。将来page-break-before将只是它的一些价值的别名。

初始值

auto

适用于

根元素的正常流程中的块级元素。用户代理也可以将其应用于其他元素,如表行元素。

遗传

没有

媒体

视觉,分页

计算值

作为指定

动画类型

离散的

规范的顺序

形式语法定义的独特的非模糊顺序

语法

auto初始值。自动分页符(既不强制也不禁止)。always始终在元素之前强制分页。

avoid避免元素之前的分页符。

left在元素之前强制分页,以便下一页被格式化为左页。

right在元素之前强制分页,以便下一页被格式化为右页。

recto如果页面从左到右进行,那么这就像right。如果页面从右到左进行,那么这就像left

verso如果页面从左到右进行,那么这就像left。如果页面从右到左进行,那么这就像right

形式语法

auto | always | avoid | left | right

实例

/* avoid page break before the div */
div.note { 
    page-break-before: avoid;
} 

规范

Specification

Status

Comment

CSS Logical Properties Level 1The definition of 'recto and verso' in that specification.

Editor's Draft

Adds the values recto and verso.

CSS Paged Media Module Level 3The definition of 'page-break-before' in that specification.

Working Draft

Extends the element that this property applies to table rows and table row groups.

CSS Level 2 (Revision 1)The definition of 'page-break-before' in that specification.

Recommendation

Initial definition

浏览器兼容性

Feature

Chrome

Edge

Firefox (Gecko)

Internet Explorer

Opera

Safari (WebKit)

Basic support (auto, always)

1.0

(Yes)

1.0 (1.7 or earlier)

4.0

7.0

1.2 (125)

avoid, left, right

1.0

?

No support (bug 132035)

4.0

7.0

1.2 (125)

Feature

Android

Edge

Firefox Mobile (Gecko)

IE Phone

Opera Mobile

Safari Mobile

Basic support

?

(Yes)

1.0 (1.0)

?

?

?

avoid, left, right

?

?

No support (bug 132035)

?

?

?

扫码关注腾讯云开发者

领取腾讯云代金券