When I use image tags in html, I try to specify its width and height in the img tag so that the browser leaves space for them even before loading the images, so when they finish loading, the page does not overpay (elements do not move). For instance:
<img width="600" height="400" src="..."/>
The problem now is that I want to create a more “responsive” version, where for the “single-column case” I would like to do this:
<img style="max-width: 100%" src="..."/>
but if I mix this with an explicit width and height, for example:
<img style="max-width: 100%" width="600" height="400" src="..."/>
and the image is wider than the available space, then the image changes without ignoring the proportion. I understand why this happens (because I "fixed" the height of the image), and I would like to fix it, but I have no idea how to do this.
To summarize: I want to specify max-width: 100% , and also somehow make sure that the content is not rescheduled when loading images.
source share