How can I ensure that a middle <div> can shrink before affecting the first <div> within a flex box ?

How can I ensure that within a flex container, the middle <div> shrinks first if needed, and if the first <div> is longer, it also shrinks without pushing the last <div> (which contains a badge) to the right, ensuring it does not shrink at all? here is the demo to the codepen: https://codepen.io/umanga/pen/WNWYore
7 Replies
ἔρως
ἔρως8mo ago
doesn't flex: basis do that?
clevermissfox
clevermissfox8mo ago
you want the first div to shrink after the middle has shrunk or not shrink at all? sounds like you need to give the first one a higher flex-grow value or if not shrink at all, remove its flex-shrink capability
ἔρως
ἔρως8mo ago
that will probably work a lot better
clevermissfox
clevermissfox8mo ago
acctually i think itll be a combination of flex-basis and messing with flex-grow/flex-shrink values depending on what OP is trying to accomplish. So they likely just need the flex property
ἔρως
ἔρως8mo ago
yup, that will probably work better
uD
uDOP8mo ago
Yes combination of, flex-grow, flex-basis and flex-shrink worked. thanks a lot guys.
ἔρως
ἔρως8mo ago
you're welcome
Want results from more Discord servers?
Add your server