Design comparison
Community feedback
- @MelvinAguilarPosted almost 2 years ago
Hi there ๐. Good job on completing the challenge ! I have some feedback for you if you want to improve your code.
- 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.
- Instead of using pixels in font-size, use relative units like
em
orrem
. The font-size in absolute units like pixels does not scale with the user's browser settings. This can cause accessibility issues for users who have set their browser to use a larger font size. You can read more about this here.
I hope you find it useful! ๐ Above all, the solution you submitted is great!
Happy coding!
1@brendowePosted almost 2 years ago@MelvinAguilar I adjusted the buttons and turned it into a. I changed the font size from px to em. But the h1 thing is not working. I tried in several ways using an h2 inside the h1 and it doesn't work. I can't even leave an h1 with nothing. If I put an h1 with something and change the display to none is that considered wrong? or do i really just leave one as h1?
0@MelvinAguilarPosted almost 2 years ago@brendowe What you are trying to do is use an <h1> right?
Update this to h2:
<h1> SEDANS </h1>
<h2> SEDANS </h2>
And you can create an '<h1>' element within your 'main' element that will be hidden visually but visible and readable by screen readers. The class "sr-only" hides content visually and here are the styles to copy. e.g.:
<h1 class="sr-only">3-column preview card component</h1>
<main> <h1 class="sr-only">3-column preview card component</h1> <div class="cartao" id="c2"> <h2>...</h2> </div> <div class="cartao" id="c2"> <h2>...</h2> </div> <div class="cartao" id="c2"> <h2>...</h2> </div> </main>
styles:
.sr-only { clip: rect(0 0 0 0); clip-path: inset(50%); height: 1px; overflow: hidden; position: absolute; white-space: nowrap; width: 1px; }
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