css - Rails app - Referencing images within a stylesheet -


so i'm working on new rails app, , within 1 of stylesheets have pg-parlex class specifies background-image link:

.bg-parlex {     padding-top: 0px;     background-image: url('assets/banner-bg.gif'); /* << url link! */     background-size: cover;     background-repeat: no-repeat;     background-attachment: fixed; } 

could explain how link assets/images folder items within...i sure assets/item1.png or assets/item2.png, perhaps link inside stylesheet maybe wrong...?

you can use:

background-image: image-url("rails.png")  #=> background-image: url(/assets/rails.png) 

if using sass-rails gem:

background-image: asset-url("rails.png", image)  #=> background-image: url(/assets/rails.png) 

so, code be:

.bg-parlex {     ...     background-image: asset-url("banner-bg.gif", image);     ... } 

Comments

Popular posts from this blog

google chrome - Developer tools - How to inspect the elements which are added momentarily (by JQuery)? -

angularjs - Showing an empty as first option in select tag -

php - Cloud9 cloud IDE and CakePHP -