Do you avoid having height/width in an image tag?

Updated by Brady Stroud [SSW] 1 year ago. See history

123
No component provided for introEmbed
<img
src="images/codeauditor-logo.png"
alt="Code Auditor logo"
width="150"
height="100"
/>
Image

❌ Figure: Bad example - Stretched image caused by inline height/width ratio that doesn't match

<img src="images/codeauditor-logo.png" alt="Code Auditor logo" />
Image

✅ Figure: Good example - Avoiding inline height/width ratio keeps the image as original

Acknowledgements

Adam Cogan
Tiago Araujo
Related rules

Need help?

SSW Consulting has over 30 years of experience developing awesome software solutions.

We open source.Loving SSW Rules? Star us on GitHub. Star