column-rule
Baseline
Widely available
This feature is well established and works across many devices and browser versions. Itâs been available across browsers since â¨2017å¹´3æâ©.
CSS column-rule ç®å屿§å¯ä»¥å¨å¤åå¸å±ä¸è®¾å®åå²çº¿çå®½åº¦ãæ ·å¼åé¢è²ã
å°è¯ä¸ä¸
column-rule: dotted;
column-rule: solid 6px;
column-rule: solid blue;
column-rule: thick inset blue;
<section id="default-example">
<p id="example-element">
London. Michaelmas term lately over, and the Lord Chancellor sitting in
Lincoln's Inn Hall. Implacable November weather. As much mud in the streets
as if the waters had but newly retired from the face of the earth, and it
would not be wonderful to meet a Megalosaurus, forty feet long or so,
waddling like an elephantine lizard up Holborn Hill.
</p>
</section>
#example-element {
columns: 3;
column-rule: solid;
text-align: left;
}
该ç®å屿§ä½¿ç¨ç®åæ¹ä¾¿ç声æå½¢å¼å°å个 column-rule-* 屿§æ¾å¨äºä¸èµ·ï¼column-rule-widthãcolumn-rule-style å column-rule-colorã
夿³¨ï¼åææç®å屿§ä¸æ ·ï¼ä»»ä½æ²¡ææå®çåç¬å¼ä¼è®¾ç½®ä¸ºç¸åºåå§å¼ï¼å¯è½ä¼è¦çéç®å屿§è®¾ç½®çå¼ï¼ã
è¯æ³
column-rule: dotted;
column-rule: solid 8px;
column-rule: solid blue;
column-rule: thick inset blue;
/* å
¨å±å¼ */
column-rule: inherit;
column-rule: initial;
column-rule: revert;
column-rule: revert-layer;
column-rule: unset;
åå¼
column-rule 屿§å¯ä»¥æä»»ä½é¡ºåºæå®ä¸ºä¸é¢ååºçä¸ä¸ªã两个æä¸ä¸ªå¼ã
<'column-rule-width'>-
å®ä¹ä¸º
<length>ææ¯thinãmediumãthickå ³é®åçå ¶ä¸ä¸ä¸ªã请åéborder-widthã <'column-rule-style'>-
请åé
border-style以è·åå¯è½çå¼å详ç»ä¿¡æ¯ã <'column-rule-color'>-
ä¸ä¸ª
<color>å¼ã
å½¢å¼å®ä¹
| åå§å¼ | 该ç®åæå¯¹åºçæ¯ä¸ªå±æ§ï¼
|
|---|---|
| éç¨å ç´ | multicol elements |
| æ¯å¦æ¯ç»§æ¿å±æ§ | å¦ |
| 计ç®å¼ | 该ç®åæå¯¹åºçæ¯ä¸ªå±æ§ï¼
|
| å¨ç»ç±»å | 该ç®åæå¯¹åºçæ¯ä¸ªå±æ§ï¼
|
å½¢å¼è¯æ³
column-rule =
<gap-rule-list> |
<gap-auto-rule-list>
<gap-rule-list> =
<gap-rule-or-repeat>#
<gap-auto-rule-list> =
<gap-rule-or-repeat>#? , <gap-auto-repeat-rule> , <gap-rule-or-repeat>#?
<gap-rule-or-repeat> =
<gap-rule> |
<gap-repeat-rule>
<gap-auto-repeat-rule> =
repeat( auto , <gap-rule># )
<gap-rule> =
<line-width> ||
<line-style> ||
<color>
<gap-repeat-rule> =
repeat( <integer [1,â]> , <gap-rule># )
<line-width> =
<length [0,â]> |
thin |
medium |
thick
<line-style> =
none |
hidden |
dotted |
dashed |
solid |
double |
groove |
ridge |
inset |
outset
示ä¾
>示ä¾ä¸
/* ä¸ "medium dotted currentcolor" ç¸å */
p.foo {
column-rule: dotted;
}
/* ä¸ "medium solid blue" ç¸å */
p.bar {
column-rule: solid blue;
}
/* ä¸ "8px solid currentcolor" ç¸å */
p.baz {
column-rule: solid 8px;
}
p.abc {
column-rule: thick inset blue;
}
示ä¾äº
HTML
<p class="content-box">
This is a bunch of text split into three columns. Take note of how the
`column-rule` property is used to adjust the style, width, and color of the
rule that appears between the columns.
</p>
CSS
.content-box {
padding: 0.3em;
background: #ff7;
column-count: 3;
column-rule: inset 2px #33f;
}
ç»æ
è§è
| Specification |
|---|
| CSS Multi-column Layout Module Level 1 > # column-rule > |