Does specifying image size in CSS allow the browser to do layout before download is complete?
- by eaolson
I've always tried to specify the height and width attributes for img tags in HTML. Not for style reasons, but because the browser then expects the size of the image and can do page layout even before the image has finished downloading. From the HTML spec:
The height and width attributes give
user agents an idea of the size of an
image or object so that they may
reserve space for it and continue
rendering the document while waiting
for the image data.
I don't know why this has never occurred to me, but does specifying height and width in CSS, rather than inside the img tag, do the same thing?