Using public images in css?


#1

I am trying to make a .rhtml that has a div tag in it. That div tag has
a
background image that is physically sitting in the public/images
directory.
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:

http://localhost:3000/images/todo_border.jpg

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

any ideas?
thanks,
M


#2

M:

Are you missing some quotes around the rule ie. “/images/
todo_border.jpg”?

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

bruce


#3

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.

HTH,
–Dave.