The flex property is a shorthand property for: flex-grow; flex-shrink; flex-basis; The flex property sets the flexible length on flexible items. Note: If the element is not a flexible item, the flex property has no effect. Remember from before, the flex property is shorthand: flex-grow is 0, flex-shrink is 1, and the width is 24%. By adding a specified width, this gives us a row of four with some space between.
We need to set the image element to 0 : .container { display: flex; } img { width: 50px; margin-right: 20px; flex-shrink: 0; }
For determining the size of a flex item the final flex-basis bound by min-width and max-width is all that matters. NOTE: The flexbox spec calls this the "hypothetical main size", but it's a lot simpler to think of it as the final flex-basis. If no flex-basis is specified, then the flex-basis falls back to the item's width property. @media all and (min-width: 600px) { .aside { flex: 1 0 0; } } I mentioned it a while ago in an earlier post and assumed someone would update the demo.
If no flex-basis is specified, then the flex …
Defines the min-width as an absolute value. Defines the min-width as a percentage of the containing block's width.