liveBook · Manning

Auto

As explained in Web Design Playground

A CSS keyword value that delegates the computed size or alignment to the browser's automatic calculation or inherited context.

Think of auto as letting the browser make the sizing decision instead of supplying a fixed measurement. In Flexbox, it appears as an allowed value for flex-basis, the starting size of a flex item. section 12.6

When you meet auto in a Flexbox rule:

  • Read it as “let the browser calculate this part.” section 12.6
  • Remember that surrounding Flexbox behavior can still grow or shrink items to fit the container. section 12.6

A flexible starting point

Use `flex-basis: auto` when the item's starting size should be handled automatically rather than fixed with a value such as `10em`. The shorthand `flex: 0 1 auto` combines that basis with Flexbox growth and shrinking settings. section 12.6

item {
    flex-basis: value|auto|content;
}

Compare auto with other permitted flex-basis values in the compact declaration pattern. section 12.6

How Web Design Playground covers it

How deep it goes
Defines auto and shows its flex-basis syntax, but stops short of detailing the browser’s complete sizing calculation.
Examples
Shows flex-basis: auto and the shorthand flex: 0 1 auto.
What it assumes
Assumes basic CSS declarations and introduces auto through Flexbox item sizing.
What you can do after
Apply it via CSS by choosing automatic sizing for a flex item’s basis.
How it connects
Connects auto with Flexbox, flex-basis, flex-grow, flex-shrink, and flex items.

Also explained in

Compare how 4 books explain auto →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Web Design Playground. The section links point to the parts of the book it draws on.