Revision 27955 of column-rule

  • Revision slug: CSS/column-rule
  • Revision title: column-rule
  • Revision id: 27955
  • Created:
  • Creator: teoli
  • Is current revision? No
  • Comment 3 words added

Revision Content

Summary

In multi-column layouts, the column-rule CSS property specifies a straight line, or "rule", to be drawn between each column. It is a convenient shorthand to avoid setting each of the individual column-rule-* properties separately : {{ Cssxref("column-rule-width") }}, {{ Cssxref("column-rule-style") }} and {{ Cssxref("column-rule-color") }}.

  • {{ Xref_cssinitial() }}: medium {{ Cssxref("none") }} currentColor
  • Applies to: all multi-column elements
  • {{ Xref_cssinherited() }}: no
  • Media: {{ Xref_cssvisual() }}

Syntax

column-rule:  <border-width> || <border-style> || <color>

Values

Accepts one, two or three values in any order:

<border-width>
Optional, is one value or keyword of:  {{ Xref_csslength() }} | thin | medium | thick
Default value medium is used if absent. See {{ cssxref("border-width") }} for details.
<border-style>
Required, default value none is used if absent. See {{ cssxref("border-style") }} for possible values and details.
<color>
Optional, see {{ Xref_csscolorvalue() }} value. Default value if absent: {{ cssxref("color_value","currentColor") }}, the value of the element's color property (foreground color).

Examples

p.foo { column-rule: dotted; }          /* same as "medium dotted currentColor" */
p.bar { column-rule: solid blue; }      /* same as "medium solid blue" */
p.baz { column-rule: solid 8px; }       /* same as "8px solid currentColor" */
p.abc { column-rule: thick inset blue; }

Live Example

padding:0.3em; background:gold; border:groove 2px gold; column-rule: inset 2px gold; column-width:17em;

Specifications

Specification Status Comment
CSS Multi-column Layout Module Level 3 {{ Spec2('CSS3 Multicol') }}  

Browser compatibility

{{ CompatibilityTable() }}

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari (WebKit)
Basic support {{ CompatVersionUnknown() }}{{ property_prefix('-webkit') }} 3.5 (1.9.1){{ property_prefix('-moz') }} 10 11.1 3.0 (522){{ property_prefix('-webkit') }}
Feature Android Firefox Mobile (Gecko) IE Phone Opera Mobile Safari Mobile
Basic support {{ CompatUnknown() }} {{ CompatVersionUnknown() }} {{ CompatUnknown() }} {{ CompatUnknown() }} {{ CompatUnknown() }}

 

See also

{{ languages( { "ja": "ja/CSS/-moz-column-rule" } ) }}

Revision Source

<h2>Summary</h2>
<p>In multi-column layouts, the <code>column-rule</code> CSS property specifies a straight line, or "rule", to be drawn between each column. It is a convenient shorthand to avoid setting each of the individual <code>column-rule-*</code> properties separately : {{ Cssxref("column-rule-width") }}, {{ Cssxref("column-rule-style") }} and {{ Cssxref("column-rule-color") }}.</p>
<ul> <li>{{ Xref_cssinitial() }}:<code> medium {{ Cssxref("none") }} <a href="/en/CSS/color_value#currentColor_Keyword" title="https://developer.mozilla.org/en/CSS/color_value#currentColor_Keyword">currentColor</a></code></li> <li>Applies to: all multi-column elements</li> <li>{{ Xref_cssinherited() }}: no</li> <li>Media: {{ Xref_cssvisual() }}</li>
</ul><h2>Syntax</h2>
<pre>column-rule:  &lt;border-width&gt; || &lt;border-style&gt; || &lt;color&gt;
</pre>
<h2>Values</h2>
<p>Accepts one, two or three values in any order:</p>
<dl> <dt>&lt;border-width&gt;</dt> <dd><em>Optional,</em> is one value or keyword of:  {{ Xref_csslength() }}<code> | thin | medium | thick </code><br> Default value<code> medium </code>is used if absent. See {{ cssxref("border-width") }} for details.</dd> <dt>&lt;border-style&gt;</dt> <dd><em>Required</em>, default value<code> none </code>is used if absent. See {{ cssxref("border-style") }} for possible values and details.</dd> <dt>&lt;color&gt;</dt> <dd><em>Optional</em>, see {{ Xref_csscolorvalue() }} value. Default value if absent: {{ cssxref("color_value","currentColor") }}, the value of the element's <span class="lang lang-en"><code><a href="../../../../en/CSS/color" rel="internal">color</a></code> </span> property (foreground color).</dd>
</dl>
<h2>Examples</h2>
<pre>p.foo { column-rule: dotted; }          /* same as "medium dotted currentColor" */
p.bar { column-rule: solid blue; }      /* same as "medium solid blue" */
p.baz { column-rule: solid 8px; }       /* same as "8px solid currentColor" */
p.abc {<code> column-rule: thick inset blue;</code> }
</pre>
<h3>Live Example</h3>
<div style="padding:0.3em; background:gold; border:groove 2px gold; -moz-column-rule:inset 2px gold; -moz-column-width:17em; -webkit-columns:17em; -webkit-column-rule:inset 2px gold; columns:17em; column-rule:inset 2px gold;"> <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>Specifications</h2>
<table class="standard-table"> <thead> <tr style="background-color: rgb(255, 204, 255);"> <th scope="col">Specification</th> <th scope="col">Status</th> <th scope="col">Comment</th> </tr> </thead> <tbody> <tr> <td><a class="external" href="http://www.w3.org/TR/css3-multicol/#column-rule" title="http://www.w3.org/TR/css3-multicol/#column-rule">CSS Multi-column Layout Module Level 3</a></td> <td>{{ Spec2('CSS3 Multicol') }}</td> <td> </td> </tr> </tbody>
</table>
<h2>Browser compatibility</h2>
<p>{{ CompatibilityTable() }}</p>
<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> <p> </p>
</div><h2>See also</h2>
<ul> <li><a href="/en/CSS_Reference" title="CSS Reference">CSS Reference</a></li> <li>{{ CSS_Reference:Columns() }}</li>
</ul>
<p>{{ languages( { "ja": "ja/CSS/-moz-column-rule" } ) }}</p>
Revert to this revision