Design comparison
Solution retrospective
How to change color of that image???
Community feedback
- @Kl3vaPosted over 2 years ago
You will have to use css filters to do that. Also, work on the link pointing to weβre you hosted your code cause it currently throws 404 error code.
0 - @melwyntPosted over 2 years ago
Hi π
Changing the color was definetely a challenge for me too.
To do this, your
img
tag needs to be in adiv
with the purple background color. Meaning that thelayer
behind your image needs to hold the purple color.In the HTML, you would have:
<div class="stats-card__hero-img"> <img src="path/to/image" alt=""> </div>
And in your CSS file, you would:
- apply the purple background color to the
div
. - and for the
img
, you need to usemix-blend-mode: multiply
with0.75
opacity.
For more details, checkout my code here on Github.
And for more information on CSS blend modes, I found this article very helpful: getflywheel.com/layout/css-blend-modes/
Happy Sunday and happy coding!
0 - apply the purple background color to the
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