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

Challenge card

@Edinson25

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


I can´t put background in the image with hover

Community feedback

Bel Sahn 440

@BelumS

Posted

Hi, the overlay was tricky for me to figure out as well.

The solution is to add an .overlay element as a sibling to the image, use position: absolute; to place the overlay on top of the image, then toggle the overlay based on the :active/:hover states.

For ex:

<div>
  <img />
  <div class="overlay">The overlaying content goes in here</div>
</div>

Next, here's a nice toggling I use for hiding an element:

.hide {
  visibility: hidden;
  opacity: 0;
}

Then use the exact opposite values for showing the element.

Check out an overlay guide here: Overlay

I hope this helps, 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