开发者

HTML Chrome Audit Specify Image Dimensions

开发者 https://www.devze.com 2023-01-01 02:29 出处:网络
I just started using the chrome developer tools for some basic html websites and I used the audit tool.

I just started using the chrome developer tools for some basic html websites and I used the audit tool.

I had two identical images, one with the height and w开发者_如何学Pythonidth attribute, and one without. On the Resources section, both the latency and the download time were identical. However, the Audit showed

Specify image dimensions (1) A width and height should be specified for all images in order to speed up page display.

Does this actually help? And are there any other ways to speed up page time?

This is only a splash page for the website I am building and as such it is only html, no css or javascript or anything. I have already compressed the images but I want to speed up load time even more. Is there a way?


Generally speaking: If you specify the image dimensions in the <img> tag, the browser will know how much space to allot for it and will proceed to render the rest of the page while simultaneously downloading the image. Otherwise, the browser will have to wait a few more milliseconds to get the size of the image from the image itself before rendering the rest of the page.

Since you have only a splash page, I doubt that there will be anything else for the browser to render, so it doesn't much matter whether you specify dimensions or not.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号