There is a picture with the given parameters width and height . Dimensions are set so that after uploading the image the layout does not 'jump'.
<img src="photo.jpg" width="900" height="400" class="photo"> How to make a responsive picture correctly? The problem is that if you add height: auto; max-width: 100%; height: auto; max-width: 100%; then the width and height attributes are simply ignored and the picture starts jumping.
That is, I want the picture to be in proportion to the width and height values, but at the same time it changes to fit the screen.
Perhaps this can be implemented using the css calc function?