Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found

Submitted

Media Query

@brendowe

Desktop design screenshot for the 3-column preview card component coding challenge

This is a solution for...

  • HTML
  • CSS
1newbie
View challenge

Design comparison


SolutionDesign

Community feedback

@MelvinAguilar

Posted

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 that Sedans, SUVs and Luxury 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 the Learn 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 or rem. 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

@brendowe

Posted

@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

@MelvinAguilar

Posted

@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

Please log in to post a comment

Log in with GitHub
Discord logo

Join 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