Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does a element with display:none set in css still get downloaded by the browser?

Tags:

html

css

Will the browser still download the image?

<img src="/myimage.jpg" style="display:none;" />
like image 710
Cato Johnston Avatar asked Jul 23 '10 03:07

Cato Johnston


1 Answers

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

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.

like image 111
Jason McCreary Avatar answered Dec 10 '22 21:12

Jason McCreary