
Design comparison
Community feedback
- P@rodrigopereira21Posted about 2 months ago
To maintain the original proportions of an image while ensuring it fits within its container, use the following CSS:
css
img { display: block; max-width: 100%; }
This ensures the image scales responsively without distortion. Additionally, consider slightly increasing the width of the container to allow for better presentation of the image, especially on larger screens.
Marked as helpful1@usman-97Posted about 2 months ago@rodrigopereira21 Thanks for your feedback, I have increased the div width so think it should look fine on bigger screens now but please feel free to have another look at it.
1
Please log in to post a comment
Log in with GitHubJoin 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