An image can be set to automatically resize itself to fit the size of its container.
All you have to do is set the image width to 100%.
If you want to restrict a responsive image to a maximum size, use the max-width property:
Resize the browser window to see the effect.