Flex item dissapears when adding flex to container
Title ^
https://jsfiddle.net/tgsb98mp/4/
5 Replies
Try un-commenting this and the card disappears, why tho?
iirc flex items shrink as much as they can. Because it has no minimum width, it shrinks to 0 and disappears
flex child is always want to be as small as possible so no content inside means it will be 0
if you set
flex-grow: 1;
on the .card
it appears again because then it tries to take up as much as possible
it'll balance with other children of the flex parent with flex-grow: 1;
thoughOhhh, I see
Thanks a lot guys, that was good to know!