property
flex-basis — CSS reference
Sets the starting main-axis size before flexible adjustment. Initial auto; not inherited. Auto consults the main-size property, then content sizing when that property is auto. A percentage uses the container’s inner main size; an indefinite basis resolves to content. Non-auto basis takes precedence over the preferred main size in determining the base.
Formal Syntax & Structure
css syntaxcss
content | <'width'> (core grammar)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:180px;flex:0 0 70px}#b{width:100px;flex:0 0 auto}</style><body><div id="p"><div id="a">A</div><div id="b">B</div></div></body></html>