# grid-auto-columns

> The `grid-auto-columns` CSS property specifies the size of implicitly created grid columns.

## How do I set the width of implicit grid columns?

The property that sets the size of columns in a grid container that are automatically generated. When items are placed outside the defined grid, this property controls the width of those additional columns, ensuring they fit within the layout.

- Topic: Grids
- Type: property
- Browser support: Chrome 57+, Chrome Android 57+, Edge 16+, Firefox 70+, Firefox Android 79+, Safari 10.1+, Safari iOS 10.3+

## Example

Wrong:

```css
.carousel {
  display: grid;
  grid-auto-flow: column;
}
```

Right:

```css
.carousel {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 80%;
  overflow-x: auto;
}
```

`grid-auto-columns` sizes every new column, so each slide takes 80% width and the row scrolls.

## Common mistakes

- Expecting `grid-auto-columns` to size columns already set by `grid-template-columns`.

## Key points

- Horizontal auto-flow layouts pair `grid-auto-flow: column` with `grid-auto-columns`.
- Implicit column sizes use `minmax()` or a fixed size when items must not collapse.

## Interview questions

### grid-auto-columns vs grid-template-columns: what is the difference?

`grid-template-columns` defines explicit columns. `grid-auto-columns` sizes columns the grid creates on its own for extra items.

### What is the default value of grid-auto-columns?

It is 'auto', so implicit columns size to their content.

## Related cards

- [grid-auto-rows](https://wonderium.dev/css/grid-auto-rows.md)
- [grid-auto-flow](https://wonderium.dev/css/grid-auto-flow.md)
- [grid-template-columns](https://wonderium.dev/css/grid-template-columns.md)
- [minmax()](https://wonderium.dev/css/minmax.md)

---

- Level: [CSS](https://wonderium.dev/css.md)
- HTML version: https://wonderium.dev/css/grid-auto-columns
- Last updated: 2026-11-25
