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 preview card using CSS flexbox

@Feyisara2306

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


What other method can one use to add color to images? The image-overlay method I used distort the card responsiveness somehow. I don't know if it's because of the height. Any feedback will be appreciated, thanks!.

Community feedback

jerry 320

@realsale

Posted

Yo! @Feyisara2306,

Great job!, just a little refinement and it will look exactly the same.

Regarding to your question, you're doing just right in overlaying element, However what's gone wrong is it's height dimension, It exceeds parents height and then cause an overflowing

overflow happens when you add overlay div that is because of it's heightyou use vh unit which is relative to viewport instead of % which is relative to the container where it is contained.

Just replace height from vw to 100%(relative to containers full height)

One more thing, I'm not familiar with<solid> tag and what it's primary purpose, but it costs you an html issue in the report, better to replace it with <span> tag.

Marked as helpful

0

@Feyisara2306

Posted

@realsale Thank you, this is very helpful!

1
jerry 320

@realsale

Posted

@Feyisara2306 Welcome and Goodluck.

0

@Enmanuel-Otero-Montano

Posted

Hello Akanni!

Another method that you can use to color the image is the filter property, here is an example 👇

.selector {
    filter: opacity(.6) drop-shadow(0 0 0 hsl(277, 64%, 61%));
}

Cheers!

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