Flex item dissapears when adding flex to container

5 Replies
rezabet
rezabet2y ago
Try un-commenting this and the card disappears, why tho?
Jochem
Jochem2y ago
iirc flex items shrink as much as they can. Because it has no minimum width, it shrinks to 0 and disappears
Mannix
Mannix2y ago
flex child is always want to be as small as possible so no content inside means it will be 0
Jochem
Jochem2y ago
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; though
rezabet
rezabet2y ago
Ohhh, I see Thanks a lot guys, that was good to know!