Why is padding expanding a flex item?
In the snippet below, the first row has two divs with flex-grow: 1 . As expected, each div takes up 50% of the screen. When adding padding to the left div, that is no longer the case. Can someone explain why? body > div { height: 50px; display: flex; } body > div > div { flex: 1; box-sizing: border-box; } #a { background-color: red; } #b { background-color: green; } #c { padding: 10px; background-color: blue; } #d { background-color: yellow; } <div> <div id="a"></div> <div id="b"></div> </div> <div> <div id="c"></div> <div id="d"></div> </div> The calculations are defined in the spec. A flex