# CSS file + Background images + facebook

**URL:** <https://www.ruby-forum.com/t/css-file-background-images-facebook/184405>\
**Category:** Rails\
**Created:** [March 2, 2010, 1:25am UTC](https://www.ruby-forum.com/t/css-file-background-images-facebook/184405 "2010-03-02T01:25:52Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jonhy\_P](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/6de8d8/32.png) [@Jonhy\_P](https://www.ruby-forum.com/u/Jonhy_P)\
**Post date:** [March 2, 2010, 1:25am UTC](https://www.ruby-forum.com/t/css-file-background-images-facebook/184405/1 "2010-03-02T01:25:52Z")

</div>

Hello,

I’m building a facebook app using rails 3.2.5 and facebooker and I’m  
having  
some trouble with background images in my CSS file.

In my css file I have the following:

#head {  
background: transparent url(/images/header\_bg.jpg) repeat-x;  
width:100%;  
height:144px;  
}

If I run the application outside facebook, everything it’s ok.

If I run the application inside facebook the background image do not  
apear…

If I use a full url location I can get it running inside facebook, for  
example:

#head {  
background: transparent url([http://somehost.com/images/header\_bg.jpg](http://somehost.com/images/header_bg.jpg))  
repeat-x;  
width:100%;  
height:144px;  
}

This makes the image render within facebook, but I don’t want to burn  
the  
host inside my css.

Another thing to note is the follwoing:

If I hit the following url (the url I use for testing the facebookapp)

[http://charliee2.no-ip.org/images/header\_bg.jpg](http://charliee2.no-ip.org/images/header_bg.jpg)

I can see the image. But if I hit the facebook app canvas url like this:

[http://apps.facebook.com/charliee2/images/header\_bg.jpg](http://apps.facebook.com/charliee2/images/header_bg.jpg)

I get the error:

No route matches “/images/header\_bg.jpg” with {:method=\>:get,  
:canvas=\>true}

Any experience with this?

Thank you,
