I want the image to fill 100% of its container width, and I want it to have a max-heigth property, and all this preserves the aspect ratio, but allows to lose any part of the image.
img { max-height:200px; width:100%; }
I know that this can be done using the background-size property, but I want to do this for the inline <img> .
Any idea how I can achieve this with CSS? or javascript?
source share