Design comparison
Solution retrospective
I didn't like the colored layer on the image, so I removed it.
What is a good way to center something in the body?
All all other feedback is appreciated!
Community feedback
- @pikapikamartPosted about 3 years ago
Hey, great work on this one. Layout is both good in desktop and mobile and it responds fine in screen resize.
Regarding you question:
- Well, it is like what you did in your
main
element, having
align-items: center; display: flex; justify-content: center;
but only applied to the
body
tag, and you would put theheight
andwidth
you declared in the.card
selector to themain
tag. Other way is:display: grid; place-content: center;
But remember to add
min-height: 100vh
to thebody
so that it will center it vertically.Using
margin: 0 auto
on the other hand centers the element with this styling, given that thewidth
of the element varies, or being explicitly given.Some suggestions would be:
- The text below the
h1
should be inside ap
tag and not justdiv
. - The information below the text, those 3 information could have used a
ul
element, since those are list of information, better to useul
. - Lastly,
padding
to the top and bottom of thebody
so that it won't touch the ceiling and flooring, especially when you inspect it in dev tools.
Other than those, this is really great.
Marked as helpful1@iliwiliPosted about 3 years ago@pikamart Thank you very much for your feedback, I will change the suggestions you gave me later on. I'm learning new stuff about how to improve my html and css because of people like you, much appreciated!!
Just a quick question, what do you mean by your last suggestion about the padding?
0@pikapikamartPosted about 3 years ago@iliwili Hey, awesome that it could be of help!
About the last, it would be great to add some
padding
to the top and bottom of thebody
tag. Because right now, if you try to inspect it in dev tools , you will notice that the layout touches the ceiling(top part) and flooring(bottom part) of the viewport and we don't want that. That is why we add some paddings to those as well.Marked as helpful1 - Well, it is like what you did in 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