NFT card component, HTML and CSS (mobile first / pseudo-element)
Design comparison
Solution retrospective
During this challenge, I got a doubt about names for element's classes. Example:
.nft-infos div p:first-child,
.nft-infos div p:last-child {
...
}
.nft-infos div p:first-child img {
width: 15px;
}
I used the ".nft-infos div..." tag several times instead of create a class name for those elements, and i don't know if it's a good practice. For me, during the code, it wasn't confusing, but I believe for other peoples who see my code later, it can be.
Another problem that I got, is from my latest project, where the Frontend Mentor reporter send me warnings about acessibility, example:
Document should have one main landmark
<html lang="en">
All page content should be contained by landmarks
<h1 class="product-name">Gabrielle Essence Eau De Parfum</h1>
I've read the documentation, and updated the html (probably solved the problem), but i got curious to learn more about acessibility. So, if anyone have an link from a documentation that tell how to create acessible pages with semantic HTML, I would be grateful.
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.
HTML π·οΈ:
- "if anyone have an link from a documentation that tell how to create acessible pages with semantic HTML ?", Actually there are ton's of resources. but here i just want to explain about the semantic markup in short and brief.
- If a site lacks semantic markup, then it causes lacking of landmark for a webpage and allows accessibility issues to screen readers, due to accessibility errors our website may not reach its intended audience, face legal consequences, and have poor search engine rankings, highlighting the importance of ensuring accessibility and avoiding errors.
- What is meant by landmark ?, They used to define major sections of your page instead of relying on generic elements like
<div>
or<span>
. They are use to provide a more precise detail of the structure of our webpage to the browser or screen readers
- For example:
- The
<main>
element should include all content directly related to the page's main idea, so there should only be one per page - The
<footer>
typically contains information about the author of the section, copyright data or links to related documents.
- The
.
I hope you find this helpful π Above all, the solution you submitted is great !
Happy coding!
Marked as helpful0@SouzaSantosKPosted over 1 year ago@0xAbdulKhalid Thank you for the comment, i replaced the "main" div for the main tag. I understanded your explanation, but just to confirm, i'm gonna use semantic HTML elements when i need to identify for browsers, groups of contents/elements, where each tag, like <section>, <main>, <footer> will be used acordling which it's content?
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