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 Vanilla Html CSS

P
beowulf1958 1,170

@beowulf1958

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


Anyone know why the jpg isn't switching correctly? And why are the dimensions off?

Community feedback

@Himanshu-196018

Posted

Hello @beowulf1958,

If you want to switch between different images, it is recommended to use <picture> tag, through which you can switch between different images according to width of your browser window.

For the dimensions try using min-width and max-width property with width for better responsive design. Same for height. For example:

  .card-container {
    width: 100%;
    min-width: 20rem;  /* give min width of your own */
    max-width: 40rem;  /* give max width of your own */
  }

I hope this will solve your problems a little bit.

Happy Coding

Marked as helpful

1

@lisztomania23

Posted

Hello, I made a few tweaks and created a pull request to your GitHub repo; merge it if you like.

1

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