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

Responsive NFT Card using only HTML and CSS

@gabriel-sotoS

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


What i found difficult was create the hover effect on the NFT image. Only that, if someone has a solution, please leave a comment!

Community feedback

@freaky4wrld

Posted

Hey there, here's what you can do to achieve the hover effect on your image......

  • first of all I would recommend you to wrap your image in a div, there's no harm in that.....
  • then create a new div that's going to give you the hover effect, give it similar width and height styling just like the nft-img
  • then you can add a background color to the newly created div, particularly using an rgba value and a background-image view-icon(eye-svg) and having a z-index of negative value
.img-overlay:{
     background-image: url(eye-icon.svg);
     background-color: rgba-value;
     width: [similar to nft-img];  
     height: [similar to nft-img];
     z-index: -1;
}
  • give your nft-img a z-index of zero #nft-img{ z-index: 0 }
  • on hover over the parent-element of the image and the overlay...... you can increase the z-index of the overlay, i.e.
.img-overlay:hover{
      z-index: [value greater than #nft-img] ;
}

I hope this works, I would recommend you to look for z-index CSS property......glad to help you :)

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