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?

Thanks

try url(/images/RRB_header.jpg);

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?

Thanks

-- Posted via http://www.ruby-forum.com/.

-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

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.

Hi!

Try to access the image using the browser.

Everaldo

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?) check that and let us know. :slight_smile:

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.

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

Dave