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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I can't get "Background-color" color working in CSS, NS

Status
Not open for further replies.

Klae

Programmer
Mar 5, 2001
269
GB
I seem to not be able to successfully set the background-color of a table using style sheets.

1. this is my stylesheet
.xcelmenutable
{
position: absolute;
left: 0px;
top: 0px;
visibility: hidden;
background-color: #6A9919;
width: 108px;
height: 72px;
z-index: -1;
}
2. I also have a style for the cells...
.menuTDclass
{
position: relative;
font-family: Verdana;
font-size: 8pt;
width: 108px;
height: 25%;
text-align: center;
vertical-align: middle;
}
3. I position the table and "show" it after a click event but only the background-color doesn't work. It does work in IE4+.. not in Netscape4.0x or Netscape4.x.
 
do you have anything in it? NS4 has this weird thing where it will only show backgrounds if there is something inside that element. luciddream@subdimension.com
 
try placing a single non-breaking space in the cell. As luciddream stated, netscape is looking for something in the box other than a link.
 
Nope doesn't work with any plain text in there. I'v sort of got somewhere putting ILAYERS in the cells with the background color set to the one I want but this is bringing its own problems and probably won't be a viable solution.
 
nesting ILAYERS in the cells and setting the background colour of the Ilayers to what I want has worked and now it behaves just like IE. In case any one finds this useful.
 
Gentlement, as the infamous book "HTML Dynamic Duo" has it. NN doesn't understand "background-color" CSS property, instead it understands "layer-background-color", so you have to write both properties in your CSS style definition.
More info here: (the Dynamic Duo book on-line)

I hope this helped.

---
---
 
Another alternative is to put a solid color background image into the cell.
Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top