The column-gap
CSS property sets the size of the gap (spacing) between an element's columns.
/* Keyword value */ column-gap: normal; /* <length> values */ column-gap: 3px; column-gap: 2.5em; /* <percentage> value */ column-gap: 3%; /* Global values */ column-gap: inherit; column-gap: initial; column-gap: unset;
The column-gap
property is specified as one of the values listed below.
normal
1em
.<length>
<length>
. It must non-negative.<percentage>
<percentage>
. It must non-negative.<length-percentage> | normalwhere
<length-percentage> = <length> | <percentage>
<p class="content-box"> This is some multi-column text with a 40px column gap created with the CSS `column-gap` property. Don't you think that's fun and exciting? I sure do! </p>
.content-box { column-count: 3; column-gap: 40px; }
Specification | Status | Comment |
---|---|---|
CSS Multi-column Layout Module The definition of 'column-gap' in that specification. | Candidate Recommendation | Initial definition. |
Initial value | normal |
---|---|
Applies to | multicol elements |
Inherited | no |
Percentages | refer to the content width of the multi-column element |
Media | visual |
Computed value | as specified with lengths made absolute |
Animation type | a length, percentage or calc(); |
Canonical order | per grammar |
Feature | Chrome | Edge | Firefox | Internet Explorer | Opera | Safari |
---|---|---|---|---|---|---|
Basic support |
50 Yes -webkit- |
Yes Yes -webkit- |
52 |
10 |
11.1 15 -webkit- |
3 -webkit- |
Feature | Android webview | Chrome for Android | Edge mobile | Firefox for Android | Opera Android | iOS Safari | Samsung Internet |
---|---|---|---|---|---|---|---|
Basic support | Yes | 50 |
Yes Yes -webkit- |
52 4 -moz- |
? | ? | ? |
1. Before Firefox 3, the default value for the normal
keyword was 0
and not 1em
.
© 2005–2018 Mozilla Developer Network and individual contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/CSS/column-gap