CSS background competing selectors question

Discussion in 'HTML' started by Derek Clarkson, Nov 6, 2003.

  1. Hi all,
    I have the following css file:

    tr td:first-child {text-align:left;}
    ..BTCategory {background-color:#99ff99;}

    In my html file I have

    <table>
    <tr>
    <td class="BTCategory"> ....</td>
    ....

    I would have thought that this would have worked creating a table with the
    first cell having the specified colour and being left justified. But
    instead the background colour is not applied. Can anyone explain why this
    is not working ?

    I thought it would because whilst both style declarations are applicable to
    the cell, they do not clash over the attributes they are setting.

    cio
    Derek.



    --
    cio
    Derek
     
    Derek Clarkson, Nov 6, 2003
    #1
    1. Advertising

  2. Derek Clarkson

    rf Guest

    "Derek Clarkson" <> wrote in message
    news:...
    > Hi all,
    > I have the following css file:
    >
    > tr td:first-child {text-align:left;}
    > .BTCategory {background-color:#99ff99;}
    >
    > In my html file I have
    >
    > <table>
    > <tr>
    > <td class="BTCategory"> ....</td>
    > ...
    >
    > I would have thought that this would have worked creating a table with the
    > first cell having the specified colour and being left justified. But
    > instead the background colour is not applied. Can anyone explain why this
    > is not working ?


    Not supported by IE AFAIK.

    Cheers
    Richard.
     
    rf, Nov 6, 2003
    #2
    1. Advertising

  3. Derek Clarkson

    Steve Pugh Guest

    "rf" <> wrote:
    >"Derek Clarkson" <> wrote:
    >>
    >> tr td:first-child {text-align:left;}
    >> .BTCategory {background-color:#99ff99;}
    >>
    >> <table>
    >> <tr>
    >> <td class="BTCategory"> ....</td>
    >>
    >> I would have thought that this would have worked creating a table with the
    >> first cell having the specified colour and being left justified. But
    >> instead the background colour is not applied. Can anyone explain why this
    >> is not working ?

    >
    >Not supported by IE AFAIK.


    Um, first-child isn't supported by IE but the OP was reporting that
    the background-color, set by a standard class selector, wasn't
    working.

    I can't replicate that error with the code given so I suspect that
    it's a clash with some other style and that the OP will need to
    provide a URL before we can investigate further.

    Steve

    --
    "My theories appal you, my heresies outrage you,
    I never answer letters and you don't like my tie." - The Doctor

    Steve Pugh <> <http://steve.pugh.net/>
     
    Steve Pugh, Nov 6, 2003
    #3
  4. Found it. It wasn't a style issue after all. I was using JBuilder to
    develope a struts site. It appears that if you change a css file in a
    Jbuilder project and recompile the project, the changed css file is not
    copied to the web server directories. I had to do a complete re-compile to
    get the css file refreshed correctly.

    Thanks to everyone who replied. I don't know if the site will work in IE as
    I'm on linux and don't have it. Frankly I choose to exercise some
    prejustice here and say "I don't support IE" in reply to all those sites
    who say "We don't support anything but IE". Although technical we are both
    wrong as the idea of the web is that you should not have to worry about
    what browser you are using ;-) such in life.



    --
    cio
    Derek
     
    Derek Clarkson, Nov 7, 2003
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Matt Beckwith

    Class and ID Selectors (CSS question)

    Matt Beckwith, Jul 12, 2003, in forum: HTML
    Replies:
    3
    Views:
    393
    David Dorward
    Jul 13, 2003
  2. Jeanne D

    Question about CSS selectors

    Jeanne D, Oct 15, 2005, in forum: HTML
    Replies:
    8
    Views:
    392
    Jeanne D
    Oct 16, 2005
  3. BMM
    Replies:
    0
    Views:
    392
  4. Thorsten Kampe

    Overview of competing Python modules?

    Thorsten Kampe, Sep 16, 2004, in forum: Python
    Replies:
    2
    Views:
    338
    Dan Sommers
    Sep 16, 2004
  5. BriC
    Replies:
    0
    Views:
    367
Loading...

Share This Page