Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Netscape won't display my table cell bg image using css 1

Status
Not open for further replies.

dalchri

Programmer
Apr 19, 2002
608
US
I'm trying to get Netscape (7.1) to recognize my css background-image style. Here is the HTML:

<td id=&quot;left&quot;>

Here is the CSS:

td#left {
background-image: url(/apex-modular-homes-images/left_apex_homes_nav.gif);
background-repeat: no-repeat;
background-color: #406358;
width: 116px;
vertical-align: top;
text-align: right;
padding: 4px;
}

I know that Netscape is recognizing the CSS file b/c I can get some of the css to take in other elements. It seems its the id and class selectors that are not working. Also, I put all this in the html using a style attribute as follows and it works fine:

<td id=&quot;left&quot; style=&quot;background-image: url(/apex-modular-homes-images/left_apex_homes_nav.gif);
background-repeat: no-repeat;
background-color: #406358;
width: 116px;
vertical-align: top;
text-align: right;
padding: 4px;&quot;>

Anybody know what gives? I seem to be seeing comments that say both that you can and can't do this with Netscape.

Thank you for any suggestions!
 
I don't really know why it is not working, but there may be an alternative way.

First of all, is the id (left) specific to that td block. You really shouldn't have two or more blocks with the same id, because the id 'identitifes' that block specifically. So if there is no other 'left' block, you should be able to just take out the 'td' in front of #left in the style sheet and it should work.

If there are more than one left, try using a class instead (i.e. class=&quot;left&quot;, then identify it with a period - td .left)

Netscape is definitely more strict than IE, so if something doesn't make sense, Netscape will ignore it, whereas IE will try and figure out what you meant.

Hope that helps.
 
There was a preceding style block that I opened with a parenthesis instead of a curly bracket that threw the rest of the file off.

I wish IE would have done what Netscape did.

Thank you for the hint on the id selector. td#left really is redundant.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top