Design comparison
SolutionDesign
Solution retrospective
What are you most proud of, and what would you do differently next time?
I am proud of completing this challenge in one day. I will attempt it again without looking at others' code.
What challenges did you encounter, and how did you overcome them?I encountered an issue with vertical centering of elements on the screen. I resolved it by setting the height of the parent container and adding margin: auto to the child container.
What specific areas of your project would you like help with?I would like to know how I can simplify and improve the logic of my code.
Community feedback
- @DarkstarXDDPosted 7 months ago
- Your
<p.title>
should be a<h1>
. Not a<p>
. - While the way you have centered the component works you can do it better. Remove the
margin: auto
on the.card
. Remove theflex-direction: column;
on the.body
. What you want here is aflex-direction: row;
but since it is the default value you don't have to specify it. Then add thejustify-content: center
to the body. This will make sure your component is horizontally centered, andalign-items: center;
will make sure your component is vertically centered. Your.body
will look like below.
body { height: 100vh; display: flex; justify-content: center; align-items: center; }
0 - Your
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