Design comparison
Community feedback
- @0xabdulkhaliqPosted over 1 year ago
Hello there 👋. Congratulations on successfully completing the challenge! 🎉
- I have other recommendations regarding your code that I believe will be of great interest to you.
HEADINGS ⚠️:
- This solution lacks usage of
<h1>
so it can cause severe accessibility errors due to lack of level-one headings<h1>
- Every site must want only one
h1
element identifying and describing the main content of the page.
- An
h1
heading provides an important navigation point for users of assistive technologies, allowing them to easily find the main content of the page.
- So we want to add 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)
- Example:
<h1 class="sr-only">NFT preview card component</h1>
- If you have any questions or need further clarification, you can always check out
my submission
for another challenge where i used this technique and feel free to reach out to me.
.
I hope you find this helpful 😄 Above all, the solution you submitted is great !
Happy coding!
0@MuhammadIrtiza17Posted over 1 year ago@0xAbdulKhalid Hello there your comments are really informative and I appreciate the you notify me this little tip in this code and my previous code too I do not need h1 so how can I add it not clear about it can you please explain briefly. :)
0@0xabdulkhaliqPosted over 1 year agoYeah you're right @MuhammadIrtiza17
- In some cases we can't add
h1
straight, but we want to add them for accessibility purposes.
- That's why we are adding a
sr-only
class, this class is not only for bootstrap it's available for every css frameworks
- You can add the style rules for
sr-only
class then theh1
will be invisible for you screens but its visible for screen readers
- Here's the styles for
sr-only
class
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border-width: 0; }
- Just add this class to any element then the targetted element will become invisible on our website.
Hope am helpful!
Marked as helpful0@0xabdulkhaliqPosted over 1 year agoPS: Sorry for the late reply, it's due to my notifications are always filled with n number replies & mentions!
Hope you get it!
0@MuhammadIrtiza17Posted over 1 year ago@0xAbdulKhalid thankyou very much for mentioning the following CSS it will be beneficial in future thankyou
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