Design comparison
SolutionDesign
Solution retrospective
Help Needed
- During the process of completing this challenge, I find aligning the card to the middle to be quite difficult. Is there an easier way to accomplish this?
- I wasn't sure whether the CSS max-width would suffice to make the card responsive even on mobile devices, although I did used relative units as best I could. What suggestions would you offer to make the site more responsive?
- Were the methods I used considered best practices or are there better alternatives that I should explore?
Community feedback
- @VickyAzolaPosted about 1 year ago
Hi! Great work finishing this challenge! For your first question, there is an easier way! When there is something you want to center vertically and horizontally, you can use a display grid or flex.
- With Grid:
body { min-height: 100vh; //sets the minimum height of the body to be 100% of the screen. display: grid; place-content: center; //align content vertically and horizontally. }
- With Flex
body { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; align-items: center; }
- For the second question, in this case, it is sufficient since the design is the same for mobile and desktop. When you need to make different designs in the future use the @media queries of CSS, here is a link for more info on that
Hope this helps!
Marked as helpful1@ebeeraheemPosted about 1 year ago@VickyAzola
Thank you so much for taking the time to respond to my questions. I had no idea about the
place-content
property at all! It's really kind of you to introduce me to it.The
@media
queries are a bit further in my studies but I think it's high time I learn about them anyways. Thank you once again, this was very helpful.1
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