The style attribute
To specify image width and height, you can use the style
attribute. It goes after the alt
attribute and defines images in pixels. Why do we need the style
attribute if we already have width
and height
attributes? Well, they're all relevant and valid, but the style
attribute prevents CSS from altering the size of images.[1]
References
- Setting Height And Width On Images Is Important Again — Smashing Magazine | Smashing Magazine