Well,

I'm attempting to use an external style sheet, but when I tested a body bgcolor all my table elements inherited the same coolor but I wanted them to retain a white bgcolor.

Also, the-

td:white {
background-color:#FFFFFF;
}

seems to be ignored by both Firefox and IE. (If this is the wrong approach please let me know.)

Any ideas? Here's my external stylesheet so far:

<style type="text/css">
body,td,th {
	font-family: Arial, Helvetica, sans-serif;
	font-size: 14px;
	color: #000000;
}
body {
	background-color: #f8c762;
}

td:white {
background-color:#FFFFFF;
}

a:link {
	color: #830605;
	text-decoration: none;
}
a:visited {
	text-decoration: none;
	color: #830605;
}
a:hover {
	text-decoration: underline;
	color: #830605;
}
a:active {
	text-decoration: none;
	color: #0b50cf;
}

a:link.dark {
 color: #f8c762; text-decoration: none; 
}
a:visited.dark { 
color: #f8c762; text-decoration: none; 
}
a:hover.dark { 
color: #ffffff; text-decoration: underline; 
}

img {border: none
}

</style>

Recommended Answers

All 3 Replies

Toddsmith,

Tables and their cells have a transparent background by default, therefore parent element's background-color shines through. For white tables you must explicitly set table, td, th background-color to #FFFFFF.

Also, the-
td:white {
background-color:#FFFFFF;
}
seems to be ignored by both Firefox and IE. (If this is the wrong approach please let me know.)

Try

td.white {
background-color:#FFFFFF;
}

"." is the class selector.
":" is only used for pseudo-classes and pseudo-elements
See http://www.w3.org/TR/CSS2/selector.html

Airshow

Airshow,

Thank you for that. Firefox was not honoring the table bgcolor settings, but once I changed the class selector as you mentioned I was able to accomplish the white bgcolor through the sytle sheet.

Thanks again! todd

There is no pseudo class named td:white.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.