Submitted over 1 year ago
Be the first to see my NFT Preview Card
@winsofttutorials
Design comparison
SolutionDesign
Solution retrospective
How did you solve the hover laying on the image?
Community feedback
- @Kamlesh0007Posted over 1 year ago
Congratulations on completing the challenge! That's a great achievement, and I'm sure you put a lot of effort into it. I really liked the way you approached the challenge and the code you wrote. You demonstrated a good understanding of the concepts and applied them effectively to solve the problem.I have a few suggestions to improve your code further. You need to add some code in body tag to make the container center
body { font-size: 18px; background-color: var(--Very-dark-blue1); display: flex; align-items: center; justify-content: center; min-height: 100vh; // addthis flex-direction: column; }
Marked as helpful0 - @mark-pherzPosted over 1 year ago
Hi there! Try this:
<div class="image-wrapper"> <img src="images/image-equilibrium.jpg" alt="icon"> <div class="overlay"> <img src="/images/icon-view.svg" alt= icon" class="icon"> </div> </div>
.image-wrapper { position: relative; } .image-wrapper img { border-radius: 10px; } .overlay { position: absolute; top: 0; width: 100%; height: 100%; border-radius: 10px; background-color: hsla(178, 100%, 50%, .5); opacity: 0; display: flex; justify-content: center; transition: opacity 0.2s cubic-bezier(0.33, 1, 0.68, 1); } .icon { margin: auto; } .image-wrapper:hover .overlay { opacity: 1; cursor: pointer; }
Marked as helpful0@winsofttutorialsPosted over 1 year agoBeautiful @mark-pherz Thank you.
0
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