Loading CSS background images before normal images?

后端 未结 4 655
抹茶落季
抹茶落季 2021-01-14 09:58

I have a ruby on rails web app, and in some views i have many heavy images( ) to render .The are generated in a Helper.

4条回答
  •  太阳男子
    2021-01-14 10:49

    Solution: Do not use the img tag.

    1. Create a sprite containing all your images. Load the sprite in your application.html layout once.
    2. Use data uris to transmit the data directly in the html. See http://css-tricks.com/data-uris/

提交回复
热议问题