Blog Preview Card using Flexbox

Solution retrospective
Hard to center the card and make it responsive. I use calc()
to make it always the same in different sizes of the screen.
Please log in to post a comment
Log in with GitHubCommunity feedback
- @marliedev
When it comes to centering elements:
- use flex or
- margin-inline
So instead of
@media screen and (min-width: 376px) { main { margin: 156px calc(100% / 8); // not good margin: 156px auto; // better } }
Marked as helpful
Join our Discord community
Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!
Join our Discord