@adityaphasu
Posted
Hi! Good job on the challenge!
Using max-width: 100%
is actually quite the most common way to make the images responsive on a website! It is usually used along with height: auto
so that the image maintains the aspect ratio and scales proportionally.
The choice of units depends on the specific design requirements, here in this challenge we want the image to scale proportionally according to screen size so %
will do here.
(some other cases might include keeping the width of the image fixed so there we would use something like rem
).
I hope this cleared your doubts! Happy coding!πΊπ»
Marked as helpful
@John-developer-18
Posted
Thanks a lot for the advice. I am grateful @adityaphasu