The w3-image class lets an image shrink to fit its container while keeping its proportions.
This image has a width of 400px. It becomes narrower when less space is available.
The w3-image class makes the image scale down if it has to, but never scale up to be larger than its original size.
Resize the window to see the image adapt.