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 Card Component With Overlay On Hover

@aszcoding

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 struggled quite a bit with getting the image overlay on hover. I think the eyeball icon is supposed to be solid white, instead of having an opacity matching the overlay; however, because the eyeball is within the overlay container, I couldn't make it keep an opacity of 1 while the rest of the overlay had an opacity of .5. If anyone has some insights on this, I'd really appreciate it!

Thank you!

Community feedback

Ahmed Bayoumi 6,740

@Bayoumi-dev

Posted

Hey Ashley,

My suggestions:

  • To fix the view-icon transparent... Use background-color: hsla(178, 100%, 50%, 0.5); instead of background-color: hsl(178, 100%, 50%); and change opacity: 0.5; to opacity: 1;
.overlay {
  //...
  background-color: hsla(178, 100%, 50%, 0.5);   /* changed */
}

.overlay:hover{
    opacity: 1;   /* changed */
    cursor: pointer;
}

  • Documents must have <title> element Uncomment
 <title>Frontend Mentor | NFT preview card component</title>
  • Document should have one main landmark, Contain the component with <main>.
<main>
   <div class="card_container">
      //...
   </div >
</main>
  • Page should contain a level-one heading, Change h2 to h1 You should always have one h1 per page of the document... in this challenge, you will use h1 just to avoid the accessibility issue that appears in the challenge report... but don't use h1 on small components <h1> should represent the main heading for the whole page, and for the best practice use only one <h1> per page.

  • All page content should be contained by landmarks, Contain the attribution with <footer>.

<footer>
   <div class="attribution">
      //...
   </div>
</footer>
  • I suggest you center the component on the page with Flexbox, by giving the parent element <main> the following properties:
body{
    background-color: hsl(217, 54%, 11%);
    color: white;
    /* padding: 120px 25px 120px 25px;     <---Rmove */
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
}
main {  /* <--- Add */
   display: flex;
   justify-content: center;
   align-items: center;
   min-height: 100vh;
 }  

Some Resources

Hope this is helpful to you... Keep coding👍

Marked as helpful

1

@aszcoding

Posted

@Bayoumi-dev Thank you so much for your detailed review of my code and for all of the feedback! I will implement your suggestions into my project.

0
Ahmed Bayoumi 6,740

@Bayoumi-dev

Posted

@aszcoding You're welcome 😊

0

@abhay6786

Posted

hey just use background-color: rgba(0, 255, 247, 0.5); in your overlay class and in overlay hover change opacity to 1.

1

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