www.webdeveloper.com
Results 1 to 2 of 2

Thread: CSS and tables

  1. #1
    Join Date
    Feb 2005
    Posts
    5

    CSS and tables

    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.

  2. #2
    Join Date
    Jan 2003
    Location
    Texas
    Posts
    10,413
    Try this...

    Code:
    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).
    Visit Slightly Remarkable to see my portfolio, resumé, and consulting rates.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles