Design comparison
Solution retrospective
Another relatively quick newbie project! Feeling ready to move on to bigger challenges and finally js.
Is there a better to way to do the image tint?
Community feedback
- @rupali317Posted 11 months ago
Hello @mhykah-webdev
Great work on completing the challenge!
You can simplify the process of implementing the image tint. I would remove all the positioning (relative, absolute) and even remove ::before related to the tint logic.
You can consider using the
mix-blend-mode
CSS property. It blends between stacked HTML elements, so elements on overlapping layers will blend with those beneath it.So, in your code, apply the purple color to your parent element i.e. picture element and then apply
mix-blend-mode: multiply
on the child element i.e img element which has the source of the image.Therefore, going by the definition, the picture element with the purple color is blending with the child element which has the image.
Hope this helps! Let me know if it works!
Marked as helpful1
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