Design comparison
Community feedback
- @HassiaiPosted over 1 year ago
Give the body a background-color of light-gray. Use the colors that were given in the styleguide.md found in the zip folder you downloaded.
There is no need to give the body position: relative.
To center .container on the page using flexbox or grid instead of margin and position: absolute, add min-height:100vh; display: flex; align-items: center: justify-content: center; or min-height:100vh; display: grid place-items: center to the body.
USING FLEXBOX: body{ min-height: 100vh; display: flex; align-items: center; justify-content: center; }
USING GRID: body{ min-height: 100vh; display: grid; place-items: center; }
For a responsive content, give .container a fixed max-width value and a padding value for all the sides.
max-width: 320px padding: 16px
Give the img a max-width of 100% instead of a width and height value for a responsive image and a border-radius value, the rest are not needed.
Give .text a margin value for all the sides, text-align: center and a font-size of 15px which is 0.9375rem, this will be the font-size of both p and h1. Give p a margin-top or h1 a margin-bottom value for the space between the text. Give p a font-color of hsl(220, 15%, 55%); for the faded color.
Use relative units like rem or em as unit for the padding, margin, width values and preferably rem for the font-size values, instead of using px which is an absolute unit. For more on CSS units Click here
Hope am helpful.
Well done for completing this challenge. HAPPY CODING
Marked as helpful0 - @visualdennissPosted over 1 year ago
Hey there,
Great job completing the challenge successfully! I've noticed few issues with the solution. One is that the card gets too wide when resizing in a wider screen, you can prevent that by adding max-width: 300px (convert this to em);
And to center the card on the page; you can simply add min-height: 100vh; to the body instead of using fixed values on the container itself. This way it would be much more flexible.
Hope you find this feedback helpful!
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