Design comparison
Solution retrospective
I spent more time making the image hover the way it should than I am willing to admit. What are other solutions to this? Is there a way to do it more efficiently and clean?
Community feedback
- @sqle157Posted over 2 years ago
Hi,
Congratulations on completing your challenge! For your question, you can try to use pseudo element
::after
or::before
instead of having anotherimg
tag in your code.For example, this is how I'm gonna handle the image hover
.art-div::after { content: ''; // you can also put the image as the content in here display: none; position: absolute; inset: 0; border-radius: 0.75rem; background: url(./images/icon-view.svg), hsl(178, 100%, 50%, 0.5); background-repeat: no-repeat; background-position: center; } .art-div:hover::after { display: block; }
I hope this answers your question!
Happy coding and good luck with further challenges!
Marked as helpful0 - @buneeIsSloPosted over 2 years ago
Hey! @its-haanna, The App looks great and responds well. I think you need to work on CSS positions, This video is a great place to start from.
Hope this helps :)
Marked as helpful0@its-haannaPosted over 2 years ago@buneeIsSlo Thank you, I'll definitely check the link out!
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