concept

flexible-length-resolution — CSS reference

First choose grow or shrink by comparing outer hypothetical sizes to the line space. Initialize targets from bases; freeze inflexible items at hypothetical sizes. Recompute remaining space from frozen targets and unfrozen bases, limiting distribution for fractional factors when appropriate. Distribute to unfrozen items by grow weights or basis-scaled shrink weights. Enforce min/max and nonnegative content sizes, freeze items according to the net clamp adjustment, and repeat until all are frozen. Final targets become used main sizes.

Formal Syntax & Structure

css syntaxcss
flex: 1 1 100px;

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{flex:1 1 100px;max-width:110px}#b{flex:1 1 100px}</style><body><div id="p"><div id="a">A</div><div id="b">B</div></div></body></html>
CSS Reference