user2012677
user2012677

Reputation: 5735

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

Upvotes: 5

Views: 1146

Answers (1)

user2012677
user2012677

Reputation: 5735

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.

Upvotes: 3

Related Questions