nft-preview-card-component - Basic HTML/CSS
Design comparison
Solution retrospective
Another challenge similar to the previous ones but this time I tried to use new things I'm learning, like improving semantic HTML5 markup, CSS Grid and Mobile-first workflow.
The main difficulty was creating the overlay effect when hovering the cursor over the image. I got a satisfactory result regarding the background color but I didn't get the same with the "view", it should have the solid bank color, and not be affected by opacity: 0.5;
. Any better way to do this?
Community feedback
- @sivakumarsPosted almost 2 years ago
Hi, Vitor.
You've done a good job on this challenge. To address your question, another way to implement the overlay effect is to use pseudo elements
::before
and::after
and position them relative to a containing block.Stack those pseudoelements using
z-index
property on hover. This way, you can control the opacity of the 'view' icon too. Right now, you have nested it inside a<a>
tag and applying thecolor
property to the anchor (<a>
) elementI usually use
position
property whenever I feel the need to overlap elements. I hope this helps you! Good luck :)Marked as helpful1@VitorMagnagoPosted almost 2 years ago@sivakumars Thanks for the feedback. I'm going to do some tests with these tips you gave me.
1
Please log in to post a comment
Log in with GitHubJoin 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