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 Main Solution

Eric Tan 80

@erictan86

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


Unfortunately unable to have the icon-view on hover over image after multiple attempts and googling. Decide to push the existing solution up on github first while continue to research.

Community feedback

Alex 660

@al3xback

Posted

Hi Eric!

Try add this to your style.

.hero-img { position: relative; }

.hero-img::after { content: ""; position: absolute; width: 100%; height: 100%; inset: 0; background: hsl(178, 100%, 50%, 60%) url(--your-icon-view-url--) no-repeat center; z-index: 1; transition: opacity 0.3s; opacity: 0; }

.hero-img:hover::after { opacity: 1; }

I hope those will help! :)

Marked as helpful

0

Eric Tan 80

@erictan86

Posted

@al3xback thank you

0
Eric Tan 80

@erictan86

Posted

@lastcodeteam12 thank you

0

Account Deleted

@al3xback @al3xback

"Simplest is the best"

I had also such a problem you can use this simple code :

.active-stats{ /* this is hover image*/ position:absolute; opacity:100%; padding:116px; margin:25px 0 0 0; background-color:rgba(0, 255, 255, 0.336); border-radius:8px; opacity:0%; } .active-stats:hover{ opacity:100%; transition:0.3s }

the idea here is that you :

. give hover image padding that cover equilibrium image (doesn't affect image dimensions).

. make its background color cyan with less opacity (alpha) this makes white eye full opacity but its background don't.

. then hide hover eye image with lowering it's opacity.

. at hover bring back its opacity, with smooth transition.

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