Submitted over 2 years ago
Product preview card component with HTML5 , CSS, Flexbox, Bootstrap 4
@Lara-trost
Design comparison
SolutionDesign
Solution retrospective
I use centering vertical in CSS 3. Can I make it differently?
Community feedback
- @cosmoartPosted over 2 years ago
Hi Larisa! Congratulations on completing this challenge... There are several better ways to center the card, I personally recommend using the position: absolute method:
main{ position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); }
I also suggest you use a more semantic HTML, you can use <main>, <section> or <article> etc.
Marked as helpful0
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