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

HTML, SASS, Flexbox, Mobile first approach

Leon 30

@valdes91

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


When moving to desktop layout and changing the cards display to flex, the image's height automatically set itself to 0. I found a way to fix this but can't help feel like its a janky solution. Any other approaches I could have taken?

Any constructive feedback appreciated.

Community feedback

I'm Fabra 160

@imfabra

Posted

Hi Leonardo, you can use "background-size" with the "cover" property, this solves the dimensioning of the image.

I invite you to see my solution and you can leave your opinion: https://www.frontendmentor.io/solutions/stats-preview-card-component-solution-html5-css3-bem-QCrz6ndBt

0

@yudiyoshida

Posted

Hey, how are you?

I had the same problem, and I got really confused when this happened hahah. Another way to fix this is: Instead of setting the image as background, you can set as a child element from 'div.image-side'.

Maybe this is not the best way, because I'm not a expert front end developer, but I hope that I've helped you.

Sorry about my english, I'm still learning. Keep coding!

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