@andreasremdt
Posted
Hey @Herteitr,
Congrats on finishing this challenge, I like how close it is to the design. Also, your HTML and CSS are really clean and easy to read, nice!
To answer your question about the image: I get what you mean, I also don't like position: absolute
that much. However, in these situations, it's the most straight-forward approach and works really good, generally speaking (as long as you don't forget position: relative
on the parent ;))
In your solution, you used a div
with the eye icon as a child, which is fine. There's a cleaner way with less HTML though, and this can be achieved by using the pseudo elements ::before
or ::after
.
You can check out my solution, where I've used this approach. It's quite similar to your solution but saves on the HTML markup. Let me know if you have any additional questions :)
Marked as helpful