Responsive 3-Column Card Component Using CSS and SCSS
Design comparison
Solution retrospective
Any tips to improve my design? Feedback is highly appreciated
Community feedback
- @correlucasPosted about 2 years ago
๐พHello Nenkimwa, Congratulations on completing this challenge!
the solution is perfect overall, there's only one problem with the alignment that can't be seen in the desktop version but the mobile yes, its not fully aligned. To fix that remove the alignment using
position
and align it withmin-height: 100vh
(to make sure it will be ever aligned vertically and centered) withflexbox
.REMOVE THIS ALIGNMENT
body .maincontainer { /* position: absolute; */ /* top: 50%; */ /* left: 50%; */ /* transform: translate(-50%, -50%); */ display: flex; flex-direction: row; }
ALIGN WITH FLEX AND MIN-HEIGHT
The step by step to do this alignment using
flexbox
andmin-height
is, first you addmin-height: 100vh
to thebody
and make it display 100% of the viewport height (this makes the container align to the height size that's now 100% of the viewport height/screen size) and then adddisplay: flex
eflex-direction: column
to align the child element (the container) vertically using the body as reference.body { min-height: 100vh; background-color: hsl(0deg, 0%, 95%); display: flex; align-items: center; justify-content: center; }
โ๏ธ I hope this helps you and happy coding!
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