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

My Responsive Design

@BMcdavitt

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 enjoyed this one. I had a bit of trouble getting the image to display appropriately in all screen resolutions, I essentially added an extra @media query just to make sure the image displayed close to correctly between mobile and full desktop. I'll be looking forward to see how others accomplished this.

Community feedback

Lucas 👾 104,420

@correlucas

Posted

👾Hello Bill McDavitt, Congratulations on completing this challenge!

Your solution its almost done and I’ve some tips to help you to improve it:

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
Maksim 590

@MaxTarasevich

Posted

Hi Bill!

Good job!

I think you need to work on some more styling to get your layout closer to the original!

In particular, the cardContent block needs padding at the top and bottom, the heading and paragraph blocks - the text in them is centered, but must be left-aligned, and the width of these blocks must be limited, use the max-width property.

At screen resolutions between 900px and 750px, your Stats preview card is pressed against the left edge of the screen.

I hope my feedback was helpful!

Marked as helpful

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