If the width
and height
attributes are set, the space required for the image is reserved immediately by the browser, even
before it actually starts to load the image.
Without those attributes, the page layout constantly changes as images are loaded until they are all loaded, which can disorient users.
Noncompliant code example
<img src="logo.png" alt="My Company" /> <!-- Non-Compliant -->
Compliant solution
<img src="logo.png" alt="My Company" width="100" height="50" /> <!-- Compliant -->