#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2000
    Location
    Lehigh Valley, PA, USA
    Posts
    1
    Rep Power
    0
    In my CSS file, I have a class defined like so:

    .contrast1 {
    bgcolor: yellow;
    }

    I've tried adding this class to several different tags (table, tr, td, h1, p, etc.) and none of them seem to work.

    I'm new to CSS... The only other class I've used:

    .toplink {
    font-size: 80%;
    }

    ... works fine. Appreciate any ideas.

    TIA,
    Frank
  2. #2
  3. No Profile Picture
    Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2001
    Location
    Estonia
    Posts
    38
    Rep Power
    14
    use:
    Code:
    background: yellow;
    or
    Code:
    background-color: yellow;
    martin.
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2000
    Location
    Copenhagen, DK
    Posts
    231
    Rep Power
    14
    background-color: yellow;
    is the right way.

    And a note:
    I have had trouble with NS 4.7, using background-image in a table-cell, when I in the next cell wanted to use background-color! NS didn't show the color.
    The way to work around this was to use css and html:

    the css:
    .image {background-image: url("my.gif");}
    .noimage {background-image: none; background-color: red;}

    and the html:
    <td class="image">blablblbal</td>
    </tr><tr>
    <td class="noimage" bgcolor="red">blablblbal</td>
  6. #4
  7. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2001
    Posts
    17
    Rep Power
    0

    Post


    The whole problem here is when using css, you have to define background-color for the correct object.

    Defining css as usual, is useless when entering into <div> <table> and form.

    You have to make separate style for these, if you have a table where you want to use background-color, just tell the html to do this, like this:

    table {
    background-color: #ffff00;
    }

    That should do it.

IMN logo majestic logo threadwatch logo seochat tools logo