Design comparison
Community feedback
- @HassiaiPosted over 1 year ago
There is no need for the section tag in the html and its styling in the css.
There is no need to style the main, give its background-color to the body.
There is no need to style .upper.
Replace the height in .card with a padding value for all the sides, this will prevent the content from overflowing on smaller screens and its a responsive replacement.
padding: 1rem which is 16px
.For a responsive content, replace the width in .card with max-width and increase its value.
max-width: 20rem which is 320px
.Give .lower 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.
To center .card on the page, 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; }
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 helpful1@HIRWA13Posted over 1 year ago@Hassiai am just a beginner on this but your solution really helped me . Thanks
0 - @MelvinAguilarPosted over 1 year ago
Hello there ๐. Good job on completing the challenge !
I have other suggestions about your code that might interest you.
Background ๐:
-
You should not recreate the background, you used the image
desktop-preview.jpg
to create your solution, but that image is for decoration and is a nice way to present the challenge, for example, you can use it in your github README.You must use the images
desktop-design.jpg
andmobile-design.jpg
to create your solution.
Alt text ๐ท:
-
The
alt
attribute should explain the purpose of the image. Uppon scanning the QR code, the user will be redirected to the frontendmentor.io website, so a betteralt
attribute would beQR code to frontendmentor.io
If you want to learn more about the
alt
attribute, you can read this article. ๐.
CSS ๐จ:
- Use
min-height: 100vh
instead ofheight
. Setting the height to 100vh may result in the component being cut off on smaller screens, such as a mobile phone in landscape orientation.
I hope you find it useful! ๐ Above all, the solution you submitted is great!
Happy coding!
0 -
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