Stats Preview Card Component Main Challenge

Solution retrospective
Hi Guys! I don't know how to make the background color on the photo so I'm asking if there's anyone who can help me.
Ok I Made It.
Please log in to post a comment
Log in with GitHubCommunity feedback
- @AtulKumar0001
Hey @Ritesh-Virulkar, To do so, add the class image-2 (or change the name, but then you must also change the CSS selector name provided below) to the div where you have placed your desktop header.jpg, and then apply this after adding the class.
.image-2{
width: 50%;
position: relative;
background-color: hsl(277, 64%, 61%);
opacity: 1;
}
After that, add another class to your img selector -> img (you can change this as well) and apply this style.
.img {
display: block;
object-fit: cover;
min-width: 100%;
opacity: .75;
mix-blend-mode: multiply;
}
Marked as helpful - @noonecaresman023
Hi, try using background: url() css property and play around with it and see if it would solve your problem. Start with this <div class="img"> <div class="img-color-overlay"></div> </div> then use background: url() property inside the .img then do the same for img-color-overlay but with a color. Looks great!
Marked as helpful - @Ritesh-Virulkar
Hi, for the background color, you can check out css property "background-blend-mode". I hope it should solve your problem and also try to have a semantic html structure to remove warnings. Rest are good! Keep up the great work.
Marked as helpful
Join 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