From 33058f2b292b3a581333bdfb21b8f671898c5060 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:40:17 -0500 Subject: initial commit --- files/zh-cn/web/css/widows/index.html | 117 ++++++++++++++++++++++++++++++++++ 1 file changed, 117 insertions(+) create mode 100644 files/zh-cn/web/css/widows/index.html (limited to 'files/zh-cn/web/css/widows') diff --git a/files/zh-cn/web/css/widows/index.html b/files/zh-cn/web/css/widows/index.html new file mode 100644 index 0000000000..9b9d2d8d26 --- /dev/null +++ b/files/zh-cn/web/css/widows/index.html @@ -0,0 +1,117 @@ +--- +title: widows +slug: Web/CSS/widows +translation_of: Web/CSS/widows +--- +
{{CSSRef}}
+ +

CSS属性 widows 可以用来设置一个块级容器在新的分页,区域或者顶部需要结合在一起的最小行数。

+ +
/* <integer> values */
+widows: 2;
+widows: 3;
+
+/* Global values */
+widows: inherit;
+widows: initial;
+widows: unset;
+
+ +
+

在排版中,widow 指的是在新页面顶部单独出现的段落的最后一行。(这一行来自于上一个页面的段落)

+
+ +

语法

+ +

+ +
+
{{cssxref("<integer>")}}
+
在一个片段打断后,新的片段顶部需要结合在一起的最小行数。该值必须为正值。
+
+ +

Formal definition

+ +

{{CSSInfo}}

+ +

Formal syntax

+ +
{{CSSSyntax}}
+ +

示例

+ +

控制列布局中的 widows

+ +

HTML

+ +
<div>
+  <p>This is the first paragraph containing some text.</p>
+  <p>This is the second paragraph containing some more text than the first one. It is used to demonstrate how widows work.</p>
+  <p>This is the third paragraph. It has a little bit more text than the first one.</p>
+</div>
+
+ +

CSS

+ +
div {
+  background-color: #8cffa0;
+  columns: 3;
+  widows: 2;
+}
+
+p {
+  background-color: #8ca0ff;
+}
+
+p:first-child {
+  margin-top: 0;
+}
+
+ +

结果

+ +

{{EmbedLiveSample("Controlling_column_widows", 400, 160)}}

+ +

规范

+ + + + + + + + + + + + + + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName('CSS3 Fragmentation', '#widows-orphans', 'widows')}}{{Spec2('CSS3 Fragmentation')}}Extends widows to apply to any type of fragment, including pages, regions, or columns.
{{SpecName('CSS3 Multicol', '#filling-columns', 'widows')}}{{Spec2('CSS3 Multicol')}}Recommendations to consider widows in relation to columns.
{{SpecName('CSS2.1', 'page.html#break-inside', 'widows')}}{{Spec2('CSS2.1')}}Initial definition.
+ +

浏览器兼容性

+ +
+ + +

{{Compat("css.properties.widows")}}

+
+ +

另请参见

+ + -- cgit v1.2.3-54-g00ecf