Responsive landing page using Html and vanila css only,
Design comparison
Solution retrospective
How can I make images to be perfectly scalable within different screen sizes? I mean, what are the available better options for doing it?
Most of the times I struggle with trying to fix this same problem where you see image getting smaller while the text-containing container beside it is getting bigger and vise-vasa as the screen size changes.
Community feedback
- @Aimal-125Posted over 1 year ago
Bro you can use:-
max-width: 100%; display: block;
if its not working then:-
width: 100%; height: 100%; display: block;
And you can also use media queries to responsify images depending on screen size. :)
Marked as helpful0 - @adityaphasuPosted over 1 year ago
Hi! Well done on completing the challenge!ππ»
To answer your question, instead of applying specific
width
to your image you can applymax-width: 100%
to your img and it will scale accordingly to the device.You can do it like this:
img { max-width: 100%; }
With this you can remove all the specific widths you have applied to your img uptil now.
- π― Here you can read more about it and how to make images responsive using css.
I hope this cleared your doubts!
Happy coding!πΊπ»
Marked as helpful0
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