覆盖CSS背景图片样式 - 两个图像都加载? [英] Overiding CSS background image styles - both images are loaded?

查看:300
本文介绍了覆盖CSS背景图片样式 - 两个图像都加载?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我有2个CSS样式将背景图像分配给一个元素,并且一个样式覆盖另一个样式。这两个图像是由浏览器还是只是覆盖一个下载?

If I have 2 CSS styles that assign background images to an element, and one style overrides the other. Will both images be downloaded by the browser or just the overriding one?

我原因是我最近参加了关于移动设备的条件样式表的研讨会。如果我覆盖我的正常bg图像与较小的,以节省带宽,将更大的图像加载反正?这似乎是什么家伙说,但它似乎奇怪,我会这样工作。

I reason im asking is I recently attended a workshop on conditional stylesheets for mobile devices. If I override my normal bg images with smaller ones to save bandwidth, will the larger images be loaded anyway? This seemed to be what the guy was saying but it seems strange to me it would work this way.

感谢

推荐答案

似乎在某些情况下,答案是肯定的:

It seems in some cases the answer is yes:

http://www.cloudfour.com/css-media-query-for-mobile-is-fools-gold/

< a href =http://www.cloudfour.com/examples/mediaqueries/image-test/#t4 =nofollow> http://www.cloudfour.com/examples/mediaqueries/image-test/# t4

这篇关于覆盖CSS背景图片样式 - 两个图像都加载?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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