Design comparison
Solution retrospective
What other method can one use to add color to images? The image-overlay method I used distort the card responsiveness somehow. I don't know if it's because of the height. Any feedback will be appreciated, thanks!.
Community feedback
- @realsalePosted over 2 years ago
Yo! @Feyisara2306,
Great job!, just a little refinement and it will look exactly the same.
Regarding to your question, you're doing just right in overlaying element, However what's gone wrong is it's
height
dimension, It exceeds parents height and then cause an overflowingoverflow
happens when you add overlay div that is because of it'sheight
you usevh
unit which is relative toviewport
instead of%
which is relative to the container where it is contained.Just replace
height
fromvw
to100%
(relative to containers full height)One more thing, I'm not familiar with
<solid>
tag and what it's primary purpose, but it costs you an html issue in the report, better to replace it with<span>
tag.Marked as helpful0 - @Enmanuel-Otero-MontanoPosted over 2 years ago
Hello Akanni!
Another method that you can use to color the image is the filter property, here is an example 👇
.selector { filter: opacity(.6) drop-shadow(0 0 0 hsl(277, 64%, 61%)); }
Cheers!
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