column-rule

  • Revision slug: CSS/column-rule
  • Revision title: column-rule
  • Revision id: 354811
  • Created:
  • Creator: FredB
  • Is current revision? No
  • Comment Various space and link corrections

Revision Content

{{ CSSRef }}

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
{{ SpecName('CSS3 Multicol', '#column-rule', 'column-rule') }} {{ 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

  • {{ CSS_Reference:Columns() }}

Revision Source

<div>
  {{ CSSRef }}</div>
<h2 id="Summary">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 class="cssprop">
  <li><dfn>{{ Xref_cssinitial() }}</dfn><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><dfn>Applies to</dfn> all multi-column elements</li>
  <li><dfn>{{ Xref_cssinherited() }}</dfn> no</li>
  <li><dfn>Media</dfn> {{ Xref_cssvisual() }}</li>
</ul>
<h2 id="Syntax">Syntax</h2>
<pre class="syntaxbox">
column-rule:  &lt;border-width&gt; || &lt;border-style&gt; || &lt;color&gt;
</pre>
<h2 id="Values">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:&nbsp; {{ 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-US/docs/CSS/color" rel="internal">color</a></code> </span> property (foreground color).</dd>
</dl>
<h2 id="Examples">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 { column-rule: thick inset blue; }
</pre>
<h3 id="Live_Example">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 id="Specifications">Specifications</h2>
<table class="standard-table">
  <thead>
    <tr>
      <th scope="col">Specification</th>
      <th scope="col">Status</th>
      <th scope="col">Comment</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>{{ SpecName('CSS3 Multicol', '#column-rule', 'column-rule') }}</td>
      <td>{{ Spec2('CSS3 Multicol') }}</td>
      <td>&nbsp;</td>
    </tr>
  </tbody>
</table>
<h2 id="Browser_compatibility">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&nbsp;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>&nbsp;</p>
</div>
<h2 id="See_also">See also</h2>
<ul>
  <li>{{ CSS_Reference:Columns() }}</li>
</ul>
Revert to this revision