aboutsummaryrefslogtreecommitdiff
path: root/files/zh-cn/web/css/column-rule/index.html
blob: be4a2b55d95d61626ceec04b7cd405699beac0ba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
---
title: column-rule
slug: Web/CSS/column-rule
tags:
  - CSS
  - CSS 多列布局
  - CSS 属性
translation_of: Web/CSS/column-rule
---
<div>{{CSSRef("CSS Multi-columns")}}</div>

<div>{{EmbedInteractiveExample("pages/css/column-rule.html")}}</div>

<h2 id="概述">概述</h2>

<p>在多列布局中,<code>column-rule</code> 属性规定了列与列之间的直线,也称“规则”。该简写可以避免单独设置各个 <code>column-rule-*</code> 属性:{{Cssxref("column-rule-width")}}{{Cssxref("column-rule-style")}}{{Cssxref("column-rule-color")}}</p>

<p>{{cssinfo}}</p>

<h2 id="语法">语法</h2>

<pre class="twopartsyntaxbox notranslate"><a href="/en-US/docs/CSS/Value_definition_syntax" title="CSS/Value_definition_syntax">Formal syntax</a>: {{csssyntax("column-rule")}}
</pre>

<pre class="notranslate">column-rule: dotted;
column-rule: solid blue;
column-rule: solid 8px;
column-rule: thick inset blue;
</pre>

<h3 id="取值">取值</h3>

<p><code>column-rule</code> 属性可以按任何顺序指定为下面列出的一个,两个或三个值。</p>

<dl>
 <dt><code>&lt;'column-rule-width'&gt;</code> </dt>
 <dd>定义为 {{cssxref("&lt;length&gt;")}} 或是 <code>thin</code><code>medium</code><code>thick</code> 关键字的其中一个。请参阅 {{cssxref("border-width")}}</dd>
 <dt><code>&lt;'column-rule-style'&gt;</code></dt>
 <dd>请参阅 {{cssxref("border-style")}}</dd>
 <dt><code>&lt;'column-rule-color'&gt;</code></dt>
 <dd>一个 {{cssxref("&lt;color&gt;")}} 值。</dd>
</dl>

<h2 id="示例">示例</h2>

<pre class="notranslate">p.foo { column-rule: dotted; }          /* 与 "medium dotted currentColor" 相同 */
p.bar { column-rule: solid blue; }      /* 与 "medium solid blue" 相同 */
p.baz { column-rule: solid 8px; }       /* 与 "8px solid currentColor" 相同 */
p.abc { column-rule: thick inset blue; }
</pre>

<h3 id="运行实例">运行实例</h3>

<div style="">
<p>padding:0.3em; background:gold; border:groove 2px gold; <strong>column-rule: inset 2px gold;</strong> <strong>column-width:17em;</strong></p>
</div>

<h2 id="规范">规范</h2>

<table class="standard-table">
 <thead>
  <tr>
   <th scope="col">规范</th>
   <th scope="col">状态</th>
   <th scope="col">说明</th>
  </tr>
 </thead>
 <tbody>
  <tr>
   <td>{{SpecName('CSS3 Multicol', '#column-rule', 'column-rule')}}</td>
   <td>{{Spec2('CSS3 Multicol')}}</td>
   <td></td>
  </tr>
 </tbody>
</table>

<h2 id="浏览器兼容性">浏览器兼容性</h2>

<div>{{CompatibilityTable}}</div>

<div id="compat-desktop">
<table class="compat-table">
 <tbody>
  <tr>
   <th>Feature</th>
   <th>Chrome</th>
   <th>Firefox (Gecko)</th>
   <th>Internet Explorer</th>
   <th>Opera</th>
   <th>Safari (WebKit)</th>
  </tr>
  <tr>
   <td>Basic support</td>
   <td>{{CompatVersionUnknown}}{{property_prefix('-webkit')}}</td>
   <td>3.5 (1.9.1){{property_prefix('-moz')}}</td>
   <td>10</td>
   <td>11.1</td>
   <td>3.0 (522){{property_prefix('-webkit')}}</td>
  </tr>
 </tbody>
</table>
</div>

<div id="compat-mobile">
<table class="compat-table">
 <tbody>
  <tr>
   <th>Feature</th>
   <th>Android</th>
   <th>Firefox Mobile (Gecko)</th>
   <th>IE Phone</th>
   <th>Opera Mobile</th>
   <th>Safari Mobile</th>
  </tr>
  <tr>
   <td>Basic support</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatVersionUnknown}}</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatUnknown}}</td>
  </tr>
 </tbody>
</table>
</div>