Submitted 6 months ago
Responsive Blog Preview card page using HTML & CSS
@thinakaran123
Design comparison
SolutionDesign
Community feedback
- @Kingkobi01Posted 6 months ago
Hi
Congratulations on finishing this challenge! 🎉🎉 Your card component looks perfect. The only problem was how to center it vertically. You can do that by giving the body a
max-width
, and amin-height
, and then making it either a flex or a grid container.For example, let's say the card has a class of
card
and this card is a direct child of the body, we can use these lines of code to center the cardbody{ max-width-100vw; min-height:100vh; overflow-x:hidden; //to prevent side-scrolling display: grid; place-items: center; }
the last two lines are those that are really doing the job. If you don't like grid you can also use flex
display: flex; align-items: center; justify-content: center;
I hope this helps. ✌🏿
Marked as helpful1
Please log in to post a comment
Log in with GitHubJoin 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