图片路径问题_html/css_WEB-ITnose

WBOY
Release: 2016-06-24 12:17:42
Original
1047 people have browsed it

网页制作中图片路径使用相对路径和绝对路径,打开网页时的效率(打开时间)是否一样。例:假设一个网页网址为:www.abc.com/a.htm,在这个网页中的图片路径用www.abc.com/images/1.jpg和images/1.jpg打开网页的效率是否一样?


回复讨论(解决方案)

这点影响可以忽略 再说了你要把路径都加上域名了 本地不好测试 以后也不好维护

网页中有很多图片的,而且只能用绝对路径。

客户端浏览器先试下载页面,获取html。
然后解析html,根据html的内容,再去请求相应的资源。

解析图片路径问题_html/css_WEB-ITnose标签图片路径信息是客户端浏览器的工作,速度取决于客户端电脑,这个是浏览器基本的工作,相信各个浏览器厂商对这一块都做到很优化了吧。

使用相对路径可以减少页面大小,从而减少页面下载网络流量...不过...这点时间应该也可以忽略。

直接文件夹前面 加上 /images/1.jpg 就可以了没必要再加上域名

我是想知道如果网页中有多个图片路径用www.abc.com/images/*.jpg会不会每次都重复解析www.abc.com这个域名?

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!