Forum Moderators: not2easy

Message Too Old, No Replies

TD background Image

Won't display on page

         

treeleaf20

2:35 pm on Jul 1, 2004 (gmt 0)

10+ Year Member



I have code that rotates style sheets so in the styles I want to be able to put a background image in a <td> tag.

The only problem with that is I'm trying to put it in a <TD> tag and when I try and use:
TD.back
{
background-color:#000000;
background-image:url(http://www.test.com/images/sprigs_search.jpg);
}

and then call it like this:
<td class="back" width="175" height="95">

It won't display anything. Anyone know what change I might have to make to get it work properly inside the <td> instead of just making it a background for the whole page?

When I do it like this though it works:
<td style="BACKGROUND-IMAGE: url(http://www.test.com/stuff/images/sprigs_search.jpg);" width="175" height="95">

I can't have it like this since I'm changing the style sheets though so I need it to work from the stylesheets but I figured I'd give some more ideas that I've already tried!

Strange

2:51 pm on Jul 1, 2004 (gmt 0)

10+ Year Member



try taking the background color out of the class. You shouldn't need it if you are calling a background image.

Strange

iamlost

4:22 am on Jul 3, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Note the differences in url quoted:

one with stuff, one without. Always confirm path.

I ran a test using my own image/address and your code works fine.

Note: you can shorten to
td.back {background:#000 url(your-image-direction.jpg);}