Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found

Submitted

responsive page landing using flexbox

Elvis 220

@Elvislex

Desktop design screenshot for the Stats preview card component coding challenge

This is a solution for...

  • HTML
  • CSS
1newbie
View challenge

Design comparison


SolutionDesign

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

Jimmy 60

@MonetCode88

Posted

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 helpful

1

Elvis 220

@Elvislex

Posted

@MonetCode88 thank you so much for this

0
hitmorecode 6,230

@hitmorecode

Posted

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 helpful

0

Elvis 220

@Elvislex

Posted

@hitmorecode thank you so much for this

0

Please log in to post a comment

Log in with GitHub
Discord logo

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