Click to See Complete Forum and Search --> : CSS and tables


dx1
03-13-2005, 08:49 PM
I just started learning CSS, and I'm trying to use it set the border colors for tables.

This is what I'm using...

<style type="text/css">
table {
background-image: url('background2.png');
border-color: #333333;
}

td.title {
border-color: #666666;
}

td.ub {
border-color: #333333;
background-color: #666666;
}
</style>

The problem is, only the bottom and right parts of the borders change colors. The top and left are black.

Also, can CSS not be used for <tr> elements? Or does it work differently for <tr> or something....? I get no results at all when I try to change the border color for <tr> using the same code as above (which half-works for <td>) and moving the class attribute, of course.
And I'm using IE6.0, if it matters.

Thanks.

Jona
03-13-2005, 08:54 PM
Try this...


table {
background-image: url('background2.png');
border: solid collapse 1px #333;
}


CSS should work for any HTML element, including TR. Also, it will always matter what browser you're using since CSS is interpreted by the browser. I should mention that IE is probably the worst browser you could design a site in, as if it works in IE it's unlikely to work in any other browser (Netscape, Firefox, Mozilla or Opera).