> For AI agents: the complete documentation index is available at /next/llms.txt, the full documentation bundle is available at /next/llms-full.txt.

# column-gap (grid-column-gap)

APISummary
## Introduction

The `column-gap`/`grid-column-gap` CSS property sets the size of the gap (gutter) between an element's columns in [flexible box layout](/next/guide/ui/layout/flexible-box-layout.md) and grid layout.

For compatibility, `column-gap` or `grid-column-gap` can be used both.

## Examples

**This is an example below: css-api**

**Entry:** `src/column-gap`
**Bundle:** `dist/column-gap.lynx.bundle`

```tsx
import { root } from "@lynx-js/react";
import "./index.scss";

const ColumnGap = () => {
  const flexContainerStyle = {
    display: "flex" as const,
    flexWrap: "wrap" as const,
    columnGap: "15px",
    margin: "10px",
    padding: "5px",
    border: "1px solid #000",
    borderRadius: "4px",
    marginBottom: "100rpx" as const,
  };

  const gridContainerStyle = {
    display: "grid" as const,
    columnGap: "10px",
    gridTemplateColumns: "1fr 1fr 1fr",
    margin: "10px",
    padding: "5px",
    border: "1px solid #000",
    borderRadius: "4px",
  };

  const titleStyle = {
    fontSize: "50rpx" as const,
    alignSelf: "center" as const,
    fontWeight: "900" as const,
    color: "linear-gradient(to right, rgb(255,53,26), rgb(0,235,235))" as const,
  };

  return (
    <>
      <text style={titleStyle}>using column-gap in flex layout</text>
      <view style={flexContainerStyle}>
        <text className="item">ONE</text>
        <text className="item">TWO</text>
        <text className="item">THREE</text>
        <text className="item">FOUR</text>
        <text className="item">FIVE</text>
        <text className="item">SIX</text>
        <text className="item">SEVEN</text>
        <text className="item">EIGHT</text>
        <text className="item">NINE</text>
        <text className="item">TEN</text>
      </view>

      <text style={titleStyle}>using column-gap in grid layout</text>
      <view style={gridContainerStyle}>
        <text className="item2">ONE</text>
        <text className="item2">TWO</text>
        <text className="item2">THREE</text>
        <text className="item2">FOUR</text>
        <text className="item2">FIVE</text>
        <text className="item2">SIX</text>
        <text className="item2">SEVEN</text>
        <text className="item2">EIGHT</text>
        <text className="item2">NINE</text>
        <text className="item2">TEN</text>
      </view>
    </>
  );
};

root.render(<ColumnGap />);

```

v0.11.0



## Syntax

```css
/* <length> values */
column-gap: 20px;
column-gap: 1em;

/* <percentage> value */
column-gap: 10%;

/* calc() values */
column-gap: calc(10% + 20px);
```

### Values

- `<length>`

Is the width of the gutter separating the columns.

- `<percentage>`

The size of the gap between columns, defined as a `percentage`. The `percentage` property's value must be non-negative.

## Formal definition

| Initial value | `0` |
| Applies to | flex containers, grid containers |
| Inherited | no |
| Animatable | no |
| Percentages | refer to row dimension of its own content area |


## Formal syntax

```
column-gap = <length-percentage [0,∞]>

<length-percentage> =
  <length>      |
  <percentage>
```

## Differences from the Web

- `normal` is not supported.

## Compatibility

**Compatibility Table**

**Query:** `css.properties.column-gap`

[Source](https://github.com/lynx-family/lynx/blob/develop/tools/css_generator/css_defines/206-column-gap.json) · [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/column-gap)

| Feature | Android | HarmonyOS | iOS | macOS | Windows | Web |
| --- | --- | --- | --- | --- | --- | --- |
| column-gap | Yes (2.14) | Yes (3.4) | Yes (2.14) | Yes (2.14) | Yes (2.14) | Yes |
| grid-column-gap | Yes (2.1) | Yes (3.4) | Yes (2.1) | Yes (2.1) | Yes (2.1) | Yes |
| supported&#95;in&#95;flex&#95;layout | Yes (2.14) | Yes (3.4) | Yes (2.14) | Yes (2.14) | Yes (2.14) | Yes |
| supported&#95;in&#95;flex&#95;layout.nested&#95;value&#95;1 | Yes (2.14) | Yes (3.4) | Yes (2.14) | Yes (2.14) | Yes (2.14) | Yes |
| supported&#95;in&#95;grid&#95;layout | Yes (2.1) | Yes (3.4) | Yes (2.1) | Yes (2.1) | Yes (2.1) | Yes |
| supported&#95;in&#95;grid&#95;layout.grid-column-gap | Yes (2.1) | Yes (3.4) | Yes (2.1) | Yes (2.1) | Yes (2.1) | Yes |
| supported&#95;in&#95;grid&#95;layout.column-gap | Yes (2.14) | Yes (3.4) | Yes (2.14) | Yes (2.14) | Yes (2.14) | Yes |

**`column-gap`**

<code>column-gap</code>

**Specifications:**

**`grid-column-gap`**

<code>grid-column-gap</code>

[Source](https://github.com/lynx-family/lynx/blob/develop/tools/css_generator/css_defines/206-column-gap.json)

**`supported_in_flex_layout`**

Supported in Flexible Box Layout

[Source](https://github.com/lynx-family/lynx/blob/develop/tools/css_generator/css_defines/206-column-gap.json)

**`supported_in_flex_layout.nested_value_1`**

<code>column-gap</code> and <code>grid-column-gap</code>

[Source](https://github.com/lynx-family/lynx/blob/develop/tools/css_generator/css_defines/206-column-gap.json)

**`supported_in_grid_layout`**

Supported in Grid Layout

[Source](https://github.com/lynx-family/lynx/blob/develop/tools/css_generator/css_defines/206-column-gap.json)

**`supported_in_grid_layout.grid-column-gap`**

<code>grid-column-gap</code>

[Source](https://github.com/lynx-family/lynx/blob/develop/tools/css_generator/css_defines/206-column-gap.json)

**`supported_in_grid_layout.column-gap`**

<code>column-gap</code>

[Source](https://github.com/lynx-family/lynx/blob/develop/tools/css_generator/css_defines/206-column-gap.json)

