css - Background Image not loading on heroku open -


When my app is ready on Heroko, my background image is not showing ..

< P> Show my logo image though

My background is mentioned in my own property / stylesheet / application.css.scss file:

   < P> body {margin: 0 px; Background: url ('city-lights1.jpg'); }  

and my logo has been referenced in my thoughts / layout / page / home file:

  & lt; Div class = 'log-image' & gt; & Lt;% = image_tag ("logo.png", alt: "image", category: 'IMG-responsive logo')% & gt; & Lt; / Div & gt;  

Why is not my background image loaded, but why does my logo image?

I am using Twitter Bootstrap

You are not using rail assistants in your application.scss as you did in your home page, so the background image URL is not referring to the expected image.

You should use Rail 4 Assistant in your application.scss file:

  Background image: property-url ("city- Lights1.jpg "); / * Or * / background-image: image-url ("city-lights1.jpg"); In addition, you can reference the property directly (note that you do not need to include the  / image  folder in the URL). Keep in mind that if the URL reference is not working in the hierocock, then you precompile your property:  
  background image: url ("/ assets / city-lights1.jpg");  

There is more detailed information about how to refer to images inside the property pipeline.


Comments

Popular posts from this blog

import - Python ImportError: No module named wmi -

Editing Python Class in Shell and SQLAlchemy -

c# - MySQL Parameterized Select Query joining tables issue -