在css中设置display:none的元素仍然会被浏览器下载吗? [英] Does a element with display:none set in css still get downloaded by the browser?

查看:627
本文介绍了在css中设置display:none的元素仍然会被浏览器下载吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

浏览器仍会下载图片吗?

Will the browser still download the image?

<img src="/myimage.jpg" style="display:none;" />


推荐答案

是的,至少根据Fire控制台

Yes, at least according to the Net console in Firebug.

thethimble 所述,CSS是表示层,影响着渲染,而不是页面的实际处理。

As stated by thethimble, CSS is the presentation layer and affects rendering, not the actual processing of the page.

它不会超出某些浏览器,特别是移动,可能无法下载这个尝试,以优化性能的可能性。

It wouldn't be outside the realm of possibility for some browsers, especially mobile, to potentially not download this in an attempt to optimize performance.

这篇关于在css中设置display:none的元素仍然会被浏览器下载吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆