column-rule

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

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() }} {{cssinitial("column-rule")}}
  • Applies to all multi-column elements
  • {{ Xref_cssinherited() }} no
  • Media {{ Xref_cssvisual() }}

Syntax

Formal syntax: {{csssyntax("column-rule")}}

Values

Accepts one, two or three values in any order:

<'column-rule-width'>
Is a {{ Xref_csslength() }} or one of the three keywords, thin, medium or thick. See {{ cssxref("border-width") }} for details.
<'column-rule-style'>
See {{ cssxref("border-style") }} for possible values and details.
<'column-rule-color'>
Is a {{ Xref_csscolorvalue() }} value.

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> </code>{{cssinitial("column-rule")}}</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">
<a href="/en-US/docs/CSS/Value_definition_syntax" title="CSS/Value_definition_syntax">Formal syntax</a>: {{csssyntax("column-rule")}}
</pre>
<h2 id="Values">Values</h2>
<p>Accepts one, two or three values in any order:</p>
<dl>
  <dt>
    <code>&lt;'column-rule-width'&gt;</code></dt>
  <dd>
    Is a {{ Xref_csslength() }} or one of the three keywords, <code>thin</code>, <code>medium</code> or <code>thick</code>. See {{ cssxref("border-width") }} for details.</dd>
  <dt>
    <code>&lt;'column-rule-style'&gt;</code></dt>
  <dd>
    See {{ cssxref("border-style") }} for possible values and details.</dd>
  <dt>
    <code>&lt;'column-rule-color'&gt;</code></dt>
  <dd>
    Is a {{ Xref_csscolorvalue() }} value.</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