CSS - column-gap
The column-gap
CSS property sets the size of the gap between columns for elements which are specified to be displayed as multi-column elements.
Example
CSS
Copy Code
.content-box { border: 10px solid #000000; column-count: 3; column-gap: 20px; }
Syntax
CSS
Copy Code
/* Keyword value */ column-gap: normal; /* <length> values */ column-gap: 3px; column-gap: 2.5em; /* Global values */ column-gap: inherit; column-gap: initial; column-gap: unset;
Values
normal
- Is a keyword indicating to use the browser-defined default spacing between columns. The specification, which most modern browsers follow, recommends that this be equal to a length of
1em
. <length>
- Is a
<length>
value defining the size of the gap between columns. It must not be negative, but may be equal to0
.
Formal syntax
CSS
Copy Code
<a href="css/length" title="Possible values: a number followed by'em', 'ex', 'ch', 'rem', 'px', 'cm', 'mm', 'in', 'vh', 'vw', 'vmin', 'vmax', 'pt', 'pc' or 'px', like 3px, 1.5cm, -0.5em or 0"><length></a> <a href="css/value_definition_syntax#single_bar" title="Single bar">|</a> normal
Description
The column-gap
CSS property sets the size of the gap between columns for elements which are specified to be displayed as multi-column elements.
Initial value | normal |
---|---|
Applies to | multicol elements |
Inherited | no |
Media | visual |
Computed value | the absolute length or the keyword normal |
Animatable | yes, as a length |
Canonical order | the unique non-ambiguous order defined by the formal grammar |
Browser Compatibility
Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari (WebKit) |
---|---|---|---|---|---|
Basic support | (Yes)-webkit | 1.5 (1.8)-moz[1] | 10 | 11.10 | 3.0 (522)-webkit |
Unprefixed | 50.0 |
Feature | Android | Android Webview | Firefox Mobile (Gecko) | IE Phone | Opera Mobile | Safari Mobile | Chrome for Android |
---|---|---|---|---|---|---|---|
Basic support | ? | ? | (Yes) | ? | ? | ? | ? |
Unprefixed | No support | 50.0 | 50.0 |
[1] Before Firefox 3 (Gecko 1.9), the default value associated to the normal
keyword was 0
and not 1em
.
See Also
Specifications
Specification | Status | Comment |
---|---|---|
CSS Multi-column Layout Module The definition of 'column-gap' in that specification. |
Candidate Recommendation | Initial definition |
License
© 2016 Mozilla Contributors
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-us/docs/web/css/column-gap