property-value

flex: auto — CSS reference

Permits growth and shrinkage from the preferred main size or content-derived starting size. Equal grow factors add equal amounts, not necessarily equal final sizes. Equivalent longhands: 1 1 auto.

Formal Syntax & Structure

css syntaxcss
flex: auto;

Working Example

Example Snippetcss
<!doctype html><html lang="en"><meta charset="utf-8"><title>CSS flexible sizing lab</title><style>body {margin:0} .sample {background:#dcebe9;color:#182e32}#p{display:flex;width:300px;align-items:flex-start;background:#e6eef2} #p>*{box-sizing:content-box;min-width:0;height:30px;background:#128579;color:white} #b{background:#326c9d}#a{width:50px;flex:auto}#b{width:100px;flex:auto}</style><body><div id="p"><div id="a">A</div><div id="b">B</div></div></body></html>
CSS Reference