And I had added width=“<some value>” to the HTML I am storing in my database, so the browser was s-t-r-e-t-c-h-i-n-g the image to 150px wide and squishing it to 30px high, thus the weird effect!!
Soooo, is there a way to keep width=“<some value>” in my database, and for this particular application, use height: 30px but keep the proportions the same so that an original image of, say, 160px wide by 120px high would change to 40px wide by 30px high?!
(I think I have some larger design issues here of how to store my Copy and HTML, but I’ll leave that for another forum…)
If you use different classes or ids in the different applications for the same image, then you can delete width=“somevalue” from the database markup and apply the required property:value in css. If only one dimension is declared, width or height, the browser will scale the image proportionally; therefore, height can rule one application and width can rule another for the same image.
If you need to keep width=“somevalue” in your database, then the width property will have to be included in your css to override the width attribute in markup.
If you set width to auto in the css then that will over-ride the width attribute in the image tag and then your 30px css height will take effect and the width will be scaled to match the aspect ratio that the 30px height requires.