Design comparison
Solution retrospective
Hi, another challenge was completed. any feedbacks are welcome. More specifically CSS layout and HTML semantics. Thanks
Community feedback
- @HassiaiPosted over 1 year ago
wrap <div class="attribution"> within the footer tag to fix the accessibility issues.
Add the alt attribute
alt=" "
to the img tag and give it a value to fix the error issue. The value of the alt attribute is the description of the image. For decorative images like icons, there is no need to give it an alt value, for more on alt attribute Click here.To center .main on the using flexbox or grid instead of 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.
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
For a responsive content replace the width in .main with max-width.
Hope am helpful.
Well done for completing this challenge. HAPPY CODING
Marked as helpful0 - @frank-itachiPosted over 1 year ago
Hello there π. You did a good job!
I have some suggestions about your code that might interest you.
HTML π:
- Wrap the
<div class="attribution">' inside the
<footer>` tag.
CSSπ¨:
- You can use grid or flexbox to center the content no matter the viewport size. Using grid you can do the following:
body { min-height: 100vh; display: grid; align-items: center; justify-content: center; }
With flex:
body { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
- Avoid using absolute length units px, especially for font-size and width properties, because they are not relative to anything else so that means they will always be the same size. Instead, you can use relative lengths like em or rem. The benefit of that last one is element which has that unit will scale relatively to everything else within the page, e.g., the parent container. You can dig up about it here
I hope you find it useful! ππ Above all, the solution you submitted is greatπ!
Happy
<coding />
π!Marked as helpful0 - Wrap the
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