Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Do images w/ display:none still make an HTTP request?

In stylesheet:

#sj {display: none}

In HTML:

<img id="sj" src="scarlett-johansson.jpg" width="640" height="360" alt="scarlett johansson" />

Does an HTTP request for the image happen or not?

like image 504
ryanve Avatar asked Jul 16 '11 20:07

ryanve


1 Answers

Yes, they still cause an HTTP request. Example: http://jsfiddle.net/RzFG2/

like image 68
Andrew Moore Avatar answered Oct 15 '22 06:10

Andrew Moore