On Sep 10, 2011, at 6:42 PM, Rick Lecoat wrote:
> My question then, pertains to minimising bandwidth requirements, and it is
> this: if an element has a background image -- eg. background-image:
> url(/myImage.png); -- and *also* has display: none applied, does the browser
> download that image or not?
Depends on the browser and the device. As far as I can tell, iOS 4.3 Mobile
Safari does download those images, but Safari 5.1 (and I think then iOS 5
Mobile Safari) do not.
You could avoid the issue by building from the bottom up, and use media queries
to load that background image only for those browsers / configurations/
resolutions that will actually see the image.
div {border: 5px solid blue; background: orange; /* etc */ } /* everybody */
@media screen and (min-device-width: 1000px) {
div {background: url(path/to/big/background.png) repeat-x; }
}
Philippe
--
Philippe Wittenbergh
http://l-c-n.com/
______________________________________________________________________
css-discuss [[email protected]]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/