Forum: Ruby on Rails Using public images in css?

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
mbonig (Guest)
on 2005-12-04 22:57
(Received via mailing list)
I am trying to make a .rhtml that has a div tag in it. That div tag has
background image that is physically sitting in the public/images
This is the CSS I have:

	position: relative;
	background-image: url(/images/todo_border.jpg);
	width: 420px;
	height: 280px;

but it doesn't display the background. I've verified that if I view:


I can see the picture. But it doesn't seem to work in the css file.

any ideas?
Bruce B. (Guest)
on 2005-12-04 23:18
(Received via mailing list)

Are you missing some quotes around the rule ie. "/images/

  Don't really know if that is the right answer, just hazarding a guess.

dteare (Guest)
on 2005-12-04 23:47
(Received via mailing list)
It should be okay without the quotes.  Here's the css rule I use
which works in FF and IE:

.email {
     background: white url(/images/envelope.gif) no-repeat top right;

Start with my working code and work towards yours.  Make sure your
selector is correct - set the text color to red or something to
ensure the right css rules are being grabbed.

This topic is locked and can not be replied to.