Image in header

I’m just getting started and have a simple question.

I want to put a .jpg in my page header.
I put the following in the CSS:
background-image: url(assets/images/RRB_header.jpg);
But, it doesn’t show up.

What am I doing wrong?


try url(/images/RRB_header.jpg);

Sent from my iPhone

I tried this in my CSS :
#header {
width: 870px;
height: 120px;
margin: 0px auto;
padding: 10px 0px;
background-image: url(/images/RRB_header.jpg);

The jpg file is in app/assets/images

But, the image doesn’t show up.


Try to access the image using the browser.


what I usually do is put the images in public/images/blablabla.jpg
then just do background-image: url(/images/RRB_header.jpg);
because I think when u do / <- this directly points to public
so if u do /assets/images/bla2.jpg means /public/assets/images/bla2.jpg
i might be wrong though.

Thanks!! - putting it in public/images worked!


dude you are wrong delete the ‘/images/’ part of your url bcuz the new
Rails asset engine dont need that (are you using rails 3.1.x right?)
that and let us know. :slight_smile:

2011/11/18 Everaldo G. [email protected]

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs