Design comparison
Solution retrospective
Can someone tell me how to change image color?
Community feedback
- @karmattPosted over 3 years ago
There's multiple ways to change the image color, but the one I like is using the ::after pseudo element (less markup).
What ::after does is place something immediately following the content of the element. So what you would do is for div that is wrapped around the image set it's position to relative.
Then create another selector:
div::after {
content: "" content is required when adding the ::before and after:: pseudo elements, but can set it to empty string
position: absolute; top: 0; left: 0; width: 100%; height: 100%; background-color: purple }
0 - @loganwoolfPosted over 3 years ago
https://codepen.io/sosuke/pen/Pjoqqp
This is a pen that will generate an image filter for the color of your choosing. Just apply the filter to the image in your css!
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