CSS Portal

CSS column-gap Property

If this site has been useful, we’d love your support! Consider buying us a coffee to keep things going strong!

Description

The column-gap property controls the inline spacing inserted between adjacent columns in a multi-column formatting context. It determines the visual and spatial separation that browsers leave between the column boxes, so it directly affects how text and other content are perceived when they flow from one column to the next. In the modern CSS gap model, it corresponds to the inline-axis part of the two-axis gap system and is used alongside row-gap and the shorthand gap.

Because the space created by column-gap sits between column boxes rather than inside them, it reduces the amount of inline space available for each column’s content without altering the interior padding of a column. When you control column sizing with properties like column-width or column-count, the chosen gap contributes to the total horizontal space the columns occupy: the browser must accommodate the sum of column widths plus the gaps when laying out the multicol container. Depending on how columns are balanced (for example, influenced by column-fill), insufficient available width can change how many columns fit or cause overflow.

Visually, decorative lines drawn between columns via the column-rule mechanism are positioned relative to the gap area and interact with it; the rule typically sits within or across the gap so that the gap and rule together define the perceived separation between columns - see column-rule. The columns shorthand can set column count and width together with the gap conceptually in mind (see columns), but column-gap remains the dedicated control for that inline-space.

From a design and accessibility standpoint, adjusting column-gap is a key way to influence readability: modest gaps help guide the eye from one column to the next, while overly narrow gaps can cause visual clutter and overly wide gaps can fragment the reading flow. Note that this property pertains to the separation of column boxes themselves and does not change intra-column spacing like line-height or padding inside individual columns. In contexts beyond traditional multi-column layout, authors frequently use the axis-aware gap properties (and their shorthands) for spacing in grid and flex layouts as well, making it easier to manage both inline and block gaps consistently.

Definition

Initial value
normal
Applies to
multi-column elements, flex containers, grid containers
Inherited
no
Computed value
as specified
Animatable
a length, percentage or calc();
JavaScript syntax
object.style.columnGap

Interactive Demo

The rusty swing set creaked a lonely lullaby in the twilight, shadows lengthening like grasping fingers across the dew-kissed grass. A lone dandelion seed, adrift on the breeze, whispered secrets of faraway fields, of dandelion suns and galaxies spun from fluff. Somewhere, beyond the veil of dusk, a coyote laughed, echoing through the stillness like a forgotten memory.

Syntax

column-gap: normal | <length> | <percentage>

Values

  • normalThe browsers default spacing is used between columns. For multi-column layout this is specified as 1em. For all other layout types it is 0.
  • <length>The size of the gap between columns, defined as a <length>. The <length> property value must be non-negative.
  • <percentage>The size of the gap between columns, defined as a <percentage>. The <percentage> property value must be non-negative.

Example

<body>
<section class="example">
<h2>CSS column-gap example</h2>
<div class="columns">
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer nec odio.</p>
<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.</p>
<p>Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante.</p>
<p>Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est.</p>
<p>Aenean viverra rhoncus pede. Praesent placerat risus quis eros.</p>
<p>Fusce pellentesque suscipit nibh. Integer vitae libero ac risus egestas placerat.</p>
</div>
</section>
</body>
.example {
  max-width: 900px;
  margin: 40px auto;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  padding: 0 16px;
  color: #333;
}

.columns {
  column-count: 3;
  column-gap: 24px; /* space between columns */
  column-rule: 1px solid #eaeaea;
}

.columns p {
  break-inside: avoid;
  margin: 0 0 1rem;
  padding: 8px;
  background: #fbfbfb;
  border-radius: 4px;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.03);
  font-size: 0.95rem;
  line-height: 1.4;
}

Browser Support

The following information will show you the current browser support for the CSS column-gap property. Hover over a browser icon to see the version that first introduced support for this CSS property.

This property is supported by all modern browsers.
Desktop
Chrome
Edge
Firefox
Opera
Safari
Tablets & Mobile
Chrome Android
Firefox Android
Opera Android
Safari iOS
Samsung Internet
Android WebView
-

Last updated by CSSPortal on: 1st January 2026

If this site has been useful, we’d love your support! Consider buying us a coffee to keep things going strong!