Any rule with img at the end of a selector can have two problems.
width:auto - CSS rules override HTML attributes. The default for width is auto, so by specifying it, the HTML attribute will be ignored.
width:100% - This is only valid when the parent width is known to be less than or equal to all child images, which would be a rare case. Otherwise, images get upscaled by the browser and not only look bad, but the HTML width attribute is ignored.
Any rule with
img
at the end of a selector can have two problems.width:auto
- CSS rules override HTML attributes. The default for width is auto, so by specifying it, the HTML attribute will be ignored.width:100%
- This is only valid when the parent width is known to be less than or equal to all child images, which would be a rare case. Otherwise, images get upscaled by the browser and not only look bad, but the HTML width attribute is ignored.