Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SASS/CSS background image preloading in rails

body
    &:after
      content: url('image1.jpg') url('image2.jpg') url('image3.jpg') url('image4.jpg') 
      display:none

I'm using the code above to preload background images. However, my display:none does not seem to work. All the images are being loaded and are visiable. Is this a browser specific thing? I'm using firefox 20 on mac or bad css/sass syntax? I need the solution to be multi-browser compatible. I just want all my images preloaded in a clean and simple way.

thank you

like image 212
user2012677 Avatar asked Oct 22 '22 12:10

user2012677


1 Answers

I have a solution:

I forgot to put a space between display and none

hence,

display:none 

does not work, but

display: none 

does work.

Sometimes it's the littlest things.

like image 190
user2012677 Avatar answered Oct 24 '22 03:10

user2012677