<?xml version="1.0" encoding="utf-8"?>

The style attribute

The style attribute Bad Practice
The style attribute Best Practice

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]

Improve your UX & Product skills with interactive courses that actually work