Want to share your CSS expertise with others? Apply to the MDN Fellowship by April 1! http://mzl.la/MDNFellowship

mozilla

Revision 494099 of column-gap

  • Revision slug: Web/CSS/column-gap
  • Revision title: column-gap
  • Revision id: 494099
  • Created:
  • Creator: kscarfone
  • Is current revision? No
  • Comment Updated tags

Revision Content

{{CSSRef("CSS Multi-columns")}}

Summary

The column-gap CSS property sets the size of the gap between columns for elements which are specified to display as a multi-column element.

{{cssbox("column-gap")}}

Syntax

Formal syntax: {{csssyntax("column-gap")}}
column-gap: 3px
column-gap: 2.5em
column-gap: normal

column-gap: inherit

Values

normal
Is a keyword indicating to use the browser-defined default spacing between columns. The specification, and most modern browsers follow it, recommends this keyword to be equal to a length of 1em.
<length>
Is a {{xref_csslength}} value defining the size of the gap between columns. It must not be negative, but may be equal to 0.

Examples

.content-box {
  border: 10px solid #000000;
  column-count: 3;
  column-gap: 20px;
}

Specifications

Specification Status Comment
{{SpecName('CSS3 Multicol', '#column-gap', 'column-gap')}} {{Spec2('CSS3 Multicol')}}  

Browser compatibility

{{CompatibilityTable}}

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari (WebKit)
Basic support {{CompatVersionUnknown}}{{property_prefix('-webkit')}} 1.5 (1.8){{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}}

[*] Before Firefox 3 (Gecko 1.9), the default value associated to the normal keyword was 0 and not 1em.

See also

Revision Source

<div>
 {{CSSRef("CSS Multi-columns")}}</div>
<h2 id="Summary" name="Summary">Summary</h2>
<p>The <code>column-gap</code> CSS property sets the size of the gap between columns for elements which are specified to display as a multi-column element.</p>
<p>{{cssbox("column-gap")}}</p>
<h2 id="Syntax" name="Syntax">Syntax</h2>
<pre class="twopartsyntaxbox">
<a href="/en-US/docs/CSS/Value_definition_syntax" title="CSS/Value_definition_syntax">Formal syntax</a>: {{csssyntax("column-gap")}}
</pre>
<pre>
column-gap: 3px
column-gap: 2.5em
column-gap: normal

column-gap: inherit
</pre>
<h3 id="Values">Values</h3>
<dl>
 <dt>
  <code>normal</code></dt>
 <dd>
  Is a keyword indicating to use the browser-defined default spacing between columns. The specification, and most modern browsers follow it, recommends this keyword to be equal to a length of <code>1em</code>.</dd>
 <dt>
  <code>&lt;length&gt;</code></dt>
 <dd>
  Is a {{xref_csslength}} value defining the size of the gap between columns. It must not be negative, but may be equal to <code>0</code>.</dd>
</dl>
<h2 id="Examples" name="Examples">Examples</h2>
<pre class="brush:css; highlight:[4]">
.content-box {
  border: 10px solid #000000;
  column-count: 3;
  column-gap: 20px;
}
</pre>
<h2 id="Specifications" name="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-gap', 'column-gap')}}</td>
   <td>{{Spec2('CSS3 Multicol')}}</td>
   <td>&nbsp;</td>
  </tr>
 </tbody>
</table>
<h2 id="Browser_compatibility" name="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>1.5 (1.8){{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>
<p>[*] Before Firefox 3 (Gecko 1.9), the default value associated to the <code>normal</code> keyword was <code>0</code> and not <code>1em</code>.</p>
<h2 id="See_also" name="See_also">See also</h2>
<ul>
 <li><a href="/en-US/docs/CSS/CSS_Reference" title="CSS Reference">CSS Reference</a></li>
 <li>{{CSS_Reference:Columns}}</li>
</ul>
Revert to this revision