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

NFT preview card component display flex, padding, margin

Peterβ€’ 200

@Kortlish

Desktop design screenshot for the NFT preview card component coding challenge

This is a solution for...

  • HTML
  • CSS
1newbie
View challenge

Design comparison


SolutionDesign

Solution retrospective


any feedback appreciated

Community feedback

P
Dave Quahβ€’ 670

@Milleus

Posted

Hi there o/

I have a few suggestions on improvement:

  • When hover effects are involved, try to use either <a> or <button> elements. Interactive elements typically link you to another page or triggers something to happen on the page. Using the right semantic elements would ensure better accessibility - think of navigating with the keyboard to highlight/trigger these elements.

  • The h2 element by default is a display: block which means it stretches to the full width. As the :hover is added directly to h2, it means that if your mouse is on the empty space to the right of the text, the hover effect would be triggered which is a little weird. Following point 1, I'd suggest something like this to fix the issue:

<h2><a href="#">Equilibrium #3429</a></h2>
a {
  color: white;
  text-decoration: none;
}

a:hover,
a:focus {
  color: cyan;
}
  • For image alt text, if it is a decorative image, keep the alt text but leave it as empty, e.g. <img src="/images/icon-clock.svg" alt="">. For non-decorative images, remember to add an alt text describing what the image is.

  • Try to use landmark HTML elements. For example,

<body>
  <main>
    ...
  </main>
</body>

Hope this helps!

Marked as helpful

1

Peterβ€’ 200

@Kortlish

Posted

@Milleus Thank you for your advices! I'll be using those solution in the future :)

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