Design comparison
Solution retrospective
I did the best I could on this challenge. But for some reason the div just wont be centered. Feedbacks will be appreciated.
Community feedback
- @HassiaiPosted almost 2 years ago
Replace<div class="container">with the main tag, <p class="p-1"> with <h1> and <div class="attribution"> with the footer tag to fix the accessibility issues. click here for more on web-accessibility and semantic html
There is no need to give the body and .container a height value, there is no need to style .qr-container and p.
To center .container on the page using flexbox or grid instead of a margin, add min-height:100vh; display: flex; align-items: center: justify-content: center; or min-height:100vh; display: grid place-items: center to the body.
To center .container on the page using flexbox: body{ min-height: 100vh; display: flex; align-items: center; justify-content: center; }
To center .container on the page using grid: body{ min-height: 100vh; display: grid; place-items: center; }
For a responsive content, replace the width in .container with max-width and increase its value and give the same padding value for all the sides.
max-width 320px padding: 15px
Give the img a max-width of 100% for a responsive image and border-radius..
Give .description 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.
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
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