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

Stats preview card component using Flex

@TaskinSultana

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 have faced width issue in images in flexbox...I'm confused how to place images in this challenge..I have use background property to place the image..but it doesn't getting me the full width and height...Need some solutions for it....and I'd be greatfull if you can give me some feedbacks to improve 🙏

Community feedback

Lucas 👾 104,420

@correlucas

Posted

👾Hello Taskin Sultana, Congratulations on completing this challenge!

You’ve done really good work here putting everything together, I’ve some suggestions to improve the design:

You need to fix the container size that is a bit off, this challenge uses the standard container size that is max-width: 1110px.

To make the image have a better fit inside of it, make the component image responsive with display: block and max-width: 100% (this makes the image fit the column/div size) and respect the component size while it scales down. To make it crop while scaling use object-fit: cover.

img {
    display: block;
    object-fit: cover;
    max-width: 100%;
}

✌️ I hope this helps you and happy coding!

Marked as helpful

0

@kevintata

Posted

Hey! To put your div and image right next to each other using flexbox, Use Flex-direction: row; That will wake your elements line up next to each other. Hope this helps!

0
Lucas Cerri 1,120

@llKryptonixll

Posted

you can add background-position: center that improves the look of the image in this case and great work btw

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