# Auto margin

*noun*

say it: **“AW-toh MAR-jin”** **/ˈɔtoʊ ˈmɑrdʒən/**

A margin set to auto, which takes up the leftover space on its side. On a block with a set width, margin: 0 auto puts it in the middle.

## What does `margin: auto` do?

An **auto margin** takes up the leftover space. On a block with a set width, `margin: 0 auto` centers it horizontally.

```css
.page { max-width: 960px; margin: 0 auto; }   /* centered on the screen */
```

## In a sentence

- “With a max-width of 60rem and an **auto margin** on each side, the article sat in the middle of the wide screen.”

Level: Apprentice · [More CSS terms at this level](https://www.ask-codey.com/glossary?category=css&level=2)

Updated: November 9, 2026

Source: https://www.ask-codey.com/glossary/auto-margin
