Design comparison
Solution retrospective
i don't know how to add color to the image. i will very grateful if someone can put me through that. thanks.
Community feedback
- @MonetCode88Posted over 1 year ago
Hey, Elvis perhaps you could nest another div within your card-img div and name it with a class of "overlay". Then put this div directly before your img tags so that it sits on top, then you can target it in CSS with hsla. The a is for the alpha channel which controls your opacity.
.overlay { position: absolute; width: 100%; height: 100%; background: hsla(277, 64%, 61%, 0.5)
setting the alpha channel to 0.5 gives you 50% opacity, this is what I did to get my image colored the correct way however I'm still new so there could be another better way. Hopefully, this helps.
Marked as helpful1 - @hitmorecodePosted over 1 year ago
Nice well done, good effort. As for your problem with the image overlay, you can solve it like this.
.card-img { position: relative; } .card-img::before { content: ""; position: absolute; top: 0; left: 0; width: 100%; height: 100%; background-color: #aa5cdb; mix-blend-mode: multiply; opacity: 0.8; }
If this doesn't make sense to you let me know
Marked as helpful0
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