I have images which have width and height in html but there is also a stylesheet affecting these images with height auto
How to reset/override this property using css so that the html height comes into effect?
Html:
<img src="..." width="350" height="150" />
Css:
img {
height: auto;
}
More info:
I'm implementing img lazyload in an environment I don't fully control (PrestaShop eCommerce).
On document ready, I'm setting the img src to a transparent pixel but as the js-fiddle shows, the image comes squared althought it doesn't have the same width/height in html.
The height is following the width because of the height auto prop.
This leads to "jumping" and also to some bugs when a script sets the height style to the wrong value.