Two of the most underused attributes of the img
element are width
and height
. If properly used, these attributes can actually speed up the overall loading and rendering of images. In fact, if you omit these attributes, browsers must perform an additional step in order to exactly calculate the dimensions of an image. For that reason, I recommend to use these attributes whenever it's possible. Many developers who use CSS think that these attributes are deprecated. This is completely wrong. The deprecated attributes for images are border
and align
, not width
and height
. Bear this in mind, especially when you're dealing with large sets of images.