please look at my very simple example of flex layout:
There is
- container with
- flex box turned on (display: flex)
- wrapping (flex-wrap: wrap)
- some items in it that have
- flex-grow is set to 1 = all items will scale equally
- flex-shrink is 0 = any items will not be scale down
- flex-basis = all items have same base width
Despite all the rulesets, items in last row have different width? How it this possible when the flex-grow says that all items will be scaled equally?
Quote from http://www.w3schools.com/cssref/css3_pr_flex-grow.asp:
The flex-grow property specifies how much the item will grow relative to the rest of the flexible items inside the same container.
That's cool, but my items in last row grow little bit more that others. Any ideas?
flex {
display: flex;
flex-wrap: wrap;
}
item {
flex: 1 0 4rem;
height: 4rem;
margin: 0.5rem;
border: 1px solid lightblue;
}
<flex>
<item></item>
<item></item>
<item></item>
<item></item>
<item></item>
<item></item>
<item></item>
<item></item>
</flex>