Design comparison
Community feedback
- @HassiaiPosted over 1 year ago
Replace <div class="container"> with the main tag and <p class="title"> with <h1> to fix the accessibility issue. click here for more on web-accessibility and semantic html
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 to container on the page using flexbox or grid instead of 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 , replace the width in .container with max-width.
You forgot to add the overlay and hover effect to the design.
Hope am helpful.
Well done for completing this challenge. HAPPY CODING
Marked as helpful1 - @0xabdulkhaliqPosted over 1 year ago
Hello there 👋. Congratulations on successfully completing your third challenge! 🎉
- I have other recommendations regarding your code that I believe will be of great interest to you.
HTML 🏷️:
- This solution generates accessibility error reports due to
non-semantic
markup
- So fix it by wrapping the
<div class="container">
with semantic element<main>
to improve accessibility and organization of your page.
- Every site must want at least one
h1
element identifying and describing the main content of the page. Anh1
heading provides an important navigation point for users of assistive technologies, allowing them to easily find the main content of the page.
- So Every site wants a level-one heading to improve accessibility by reading aloud the heading by screen readers, you can achieve this by adding a
sr-only
class to hide it from visual users (it will be useful for visually impaired users)
Alt text 📷:
- The
alt
attribute should not contain underscores or hyphens, it must be human readable and understandable.
- The
alt
attribute should not contain the words "image", "photo", or "picture", because the image tag already conveys that information.
- Not all images should have
alt
text. The<img src="images/icon-clock.svg">
is a decorative image, it does not add any information to the page. You should use an emptyalt
attribute instead of a descriptive one. You can read more about this here 📘.
- Eg:
<img src="images/icon-clock.svg" alt="">
- If you want to learn more about the alt attribute, you can read this article 📘.
I hope you find it helpful 😄 Above all, the solution you submitted is great !
Happy coding!
Marked as helpful1
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