@SheGeeks
Posted
You definitely used flexbox correctly to center the card and structure the card contents.
I noticed you're using an absolute value (px
) to set the width of the card. When you need an element to be adaptable, like the width of this card, it's best to avoid giving it an absolute value.
For a better approach set the card width to 100% (width: 100%
) to always take up the available space in width and give it a max-width of your absolute value ( max-width: 384px
) to limit how big it can grow.
With these changes, your card will always take up the maximum amount of available width space no matter what screen size, but never more than 384px. In my solution I think I also set a min-width
to prevent it from going below a certain size. That's optional though.
Marked as helpful
@kadiryildiri
Posted
@SheGeeks Thank you for your advice. I will use your suggestion in my next coding