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. Advertisements

  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. Advertisements

  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. Advertisements

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:
    508
    David Dorward
    Jul 13, 2003
  2. Nik Coughin

    css - descendant selectors

    Nik Coughin, Jan 28, 2004, in forum: HTML
    Replies:
    2
    Views:
    514
    Alliss
    Jan 29, 2004
  3. Jeanne D

    Question about CSS selectors

    Jeanne D, Oct 15, 2005, in forum: HTML
    Replies:
    8
    Views:
    505
    Jeanne D
    Oct 16, 2005
  4. Jon Slaughter

    css selectors

    Jon Slaughter, Apr 17, 2007, in forum: HTML
    Replies:
    13
    Views:
    1,140
    Ben C
    Apr 21, 2007
  5. Nathan Sokalski

    Help With CSS Selectors

    Nathan Sokalski, Mar 24, 2008, in forum: ASP .Net
    Replies:
    5
    Views:
    520
    Just Me
    Mar 24, 2008
  6. Nathan Sokalski

    Adjacent Sibling Selectors in CSS

    Nathan Sokalski, Jun 23, 2008, in forum: ASP .Net
    Replies:
    5
    Views:
    818
    Arthur Milfait
    Jun 30, 2008
  7. rodchar

    css selectors help

    rodchar, Jul 17, 2008, in forum: ASP .Net
    Replies:
    3
    Views:
    445
    rodchar
    Jul 20, 2008
  8. Andrew Poulos

    Changing CSS 2.1 descendant selectors

    Andrew Poulos, Feb 2, 2005, in forum: Javascript
    Replies:
    5
    Views:
    317
    Martin Honnen
    Feb 2, 2005
Loading...