Design comparison
Solution retrospective
My 3rd Frontendmentor challenge. All feedbacks are welcome
Community feedback
- @MelvinAguilarPosted almost 2 years ago
Hello there π. Good job on completing the challenge !
I have some suggestions about your code that might interest you.
HTML π:
- You should use only one
<h1>
tag per page. The<h1>
tag is the most important heading tag, This can confuse screen reader users and search engines. This challenge requires thatSedans
,SUVs
andLuxury
are headings, but you can use the<h2>
tag instead of the<h1>
tag. You can read more about this here π.
- You should use the
<a>
tag instead of the<button>
tag because theLearn More
button is a link to another page. Use buttons to perform actions like submitting a form or closing a modal and use links to navigate to another page. You can read more about this here π.
-
The images of the cars are for decoration, add
aria-hidden="true"
andfocusable="false"
to the SVG to hide it from screen readers and not allow it to be accessible using the tab key in some browsers.The main reason for hiding an SVG from screen readers is that SVGs can be used for decorative elements and may not provide any meaningful information to users of assistive technology. Hiding them from screen readers can prevent confusion and reduce the amount of unnecessary information that is read to users.
You can read more about this here π
CSS π¨:
- Setting the font-size to 62.5% can attract compatibility issues with third-party libraries or plugins. You can read more about this with this two lectures:
Credit to grace-snow and vanzasetia for pointing this out.
- Use
min-height: 100vh
instead ofheight: 100vh
. Theheight
property will not work if the content of the page grows beyond the height of the viewport.
I hope you find it useful! π Above all, the solution you submitted is great!
Happy coding!
2@GamesLegendPosted almost 2 years ago@MelvinAguilar Tysm for your review. From suggestions mentioned above, I know most of them, even the 62.5% trick(I always use that trick). What I didn't knew is the suggestion about SVG and the min-height(I know only max-height). Long story short, I found it useful ππ
0 - You should use only one
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