Responsive preview stat card component

Solution retrospective
Any support in making cleaner code or enhancing my project is appreciated. Happy coding everyone!
Please log in to post a comment
Log in with GitHubCommunity feedback
- @PeshwariNaan
Hello Veronica. Nice work on the card. One thing that I think will help you is how to make the image responsive. Create a <div> container that will hold your image -
<div class="image-container"> <img class="image" src="./whatever"> </div> -Once you have this add this code to your .image css code: .image { max-width: 100%; max-height: 100%; object-fit: contain; overflow: hidden; } This will force the image fill the container and change responsively and keep its aspect ratio.
Marked as helpful - @Wandesanguine
You’re really good. I learnt a lot from your code. I have to apply them in my own code
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