CSS参考手册
网页媒体 | Paged Media
page-break-before
该page-break-before
CSS属性调整分页符之前的当前元素。
此属性适用于生成框的块元素。它不会适用于<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) |
? |
? |
? |
网页媒体 | Paged Media相关
层叠样式表( Cascading Style Sheets )是一种用来表现 HTML 或 XML 等文件样式的计算机语言。CSS 不仅可以静态地修饰网页,还可以配合各种脚本语言动态地对网页各元素进行格式化。