widows
æéå¯ç¨
æ¤ç¹æ§ä¸å±äºåºçº¿ï¼å 为å®å°æªå¨ä¸»æµæµè§å¨ä¸å¾å°æ¯æã
Want more browser support for this feature? Tell us why.
CSS 屿§ widows å¯ä»¥ç¨æ¥è®¾ç½®ä¸ä¸ªå级容å¨å¨æ°çå页ï¼åºåæè
åçé¡¶é¨éè¦ç»åå¨ä¸èµ·çæå°è¡æ°ã
css
/* <integer> values */
widows: 2;
widows: 3;
/* Global values */
widows: inherit;
widows: initial;
widows: unset;
夿³¨ï¼å¨æçä¸ï¼widow æçæ¯å¨æ°é¡µé¢é¡¶é¨åç¬åºç°ç段è½çæåä¸è¡ãï¼è¿ä¸è¡æ¥èªäºä¸ä¸ä¸ªé¡µé¢ç段è½ï¼
è¯æ³
>å¼
<integer>-
å¨ä¸ä¸ªç段ææåï¼æ°ççæ®µé¡¶é¨éè¦ç»åå¨ä¸èµ·çæå°è¡æ°ã该å¼å¿ 须为æ£å¼ã
å½¢å¼å®ä¹
| åå§å¼ | 2 |
|---|---|
| éç¨å ç´ | åºå容å¨å ç´ |
| æ¯å¦æ¯ç»§æ¿å±æ§ | æ¯ |
| 计ç®å¼ | as specified |
| å¨ç»ç±»å | æè®¡ç®å¼çç±»å |
å½¢å¼è¯æ³
widows =
<integer [1,â]>
<integer> =
<number-token>
示ä¾
>æ§å¶åå¸å±ä¸ç widows
HTML
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
css
div {
background-color: #8cffa0;
columns: 3;
widows: 2;
}
p {
background-color: #8ca0ff;
}
p:first-child {
margin-top: 0;
}
ç»æ
è§è
| è§è |
|---|
| CSS Fragmentation Module Level 3 > # widows-orphans > |
| CSS Multi-column Layout Module Level 1 > # filling-columns > |