widows
Limited availability
This feature is not Baseline because it does not work in some of the most widely-used browsers.
CSS 属性 widows
可以用来设置一个块级容器在新的分页,区域或者列的顶部需要结合在一起的最小行数。
css
/* values */
widows: 2;
widows: 3;
/* Global values */
widows: inherit;
widows: initial;
widows: unset;
备注: 在排版中,widow 指的是在新页面顶部单独出现的段落的最后一行。(这一行来自于上一个页面的段落)
语法
值
形式定义
形式语法
示例
控制列布局中的 widows
HTML
html
This is the first paragraph containing some text.
This is the second paragraph containing some more text than the first one.
It is used to demonstrate how widows work.
This is the third paragraph. It has a little bit more text than the first
one.
CSS
css
div {
background-color: #8cffa0;
columns: 3;
widows: 2;
}
p {
background-color: #8ca0ff;
}
p:first-child {
margin-top: 0;
}
结果
规范
Specification |
---|
CSS Fragmentation Module Level 3 # widows-orphans |
CSS Multi-column Layout Module Level 1 # filling-columns |