13. Specify image dimensions

Specifying a width and height for all images allows for faster rendering by eliminating the need for unnecessary reflows and repaints. If height and width are not set, the browser does not know the size of the image, and cannot reserve the appropriate space to it. The effect will be that the page layout will change during loading (while the images load).i.e. the browser will require a reflow and repaint once the images are downloaded. .

Objectives:

Guidelines:

Good Example:

An image with a height and a width of 42 pixels:

<img src="smiley.gif" alt="Smiley face" height="42" width="42">

Bad Example:

<img src="logo.gif" width="125" alt="logo">

(Only one dimension has been specified)