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

3-column preview card component

LoZoโ€ข 440

@LoZoCz

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

Lucas ๐Ÿ‘พโ€ข 104,540

@correlucas

Posted

๐Ÿ‘พHello @LoZoCz, Congratulations on completing this challenge!

Great code and great solution! Iโ€™ve few suggestions for you that you can consider adding to your code:

  • Add the correct color for the background, that in this case is background-color: #F2F2F2
  • The html structure entirely with div blocks but these div doesn't any semantic meaning, for this reason is better you use a better html markup improving your code, for example for each vehicle card you use <article> instead of the <div>.
  • The icon doesnโ€™t have an important role when you think about semantics and the html structure. So you can add aria-hidden=โ€œtrueโ€ to avoid it being found and read in the accessibility mode/screen readers. These are only decorative items.
  • Use max-width: 100% for the cards in the mobile version to allow the cards grow 100% of the width considering the paddings and avoid to have a lateral gap (limited by a fixed width).
  • To make your CSS code easier to work you can create a single class to manage the content that is mostly the same for the 3 cards (paddings, colors, margins and etc) and another class to manage the characteristics that are different (colors and icon), this way you'll have more control over then and if you need to change something you modify only one class.
  • Think about using relative units as rem or em instead of px to improve your performance by resizing fonts between different screens and devices. Anyhow, if we want a more accessible website, then we should use rem instead of px. REM does not just apply to font size, but to all sizes as well.

โœŒ๏ธ I hope this helps you and happy coding!

0

@VCarames

Posted

Hey @LoZoCz, some suggestions to improve you code:

  • To give you HTML code structure, you want to set up your code in the following manner (only did parent containers):
  <body>
      <main>
        <article>
          <article class="sedan-card"></article>
          <article class="sedan-card"></article>
          <article class="luxury-card"></article>
        </article>
      </main>
    </body>

The Main Element identifies the main content of the document.

While the Article Element will serve as the cardโ€™s container, because the card represents a complete, or self-contained, section of content that is, in principle, independently reusable.

Lastly, each card will be wrapped in their own Article Element because they too, are complete, or self-contained, section of content that is, in principle, independently reusable.

More info:

https://web.dev/learn/html/headings-and-sections/

  • The car images/icons serve no other purpose than to be decorative; They add no value. Their Alt Tag should left blank and have an aria-hidden=โ€œtrueโ€ to hides it from assistive technology.

  • The headings are being use incorrectly. For this challenge, each heading is equally as important. So best option, is to use <h2> Heading, because it will give each card the same level of importance and it's reusable.

  • Remove the height from section, it is not needed. Your content and padding will create the height.

Happy Coding! ๐Ÿ‘ป๐ŸŽƒ

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