CSS background competing selectors question

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
Hi all,
        I have the following css file:

tr td:first-child

In my html file I have

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



Re: CSS background competing selectors question

Quoted text here. Click to load it

Not supported by IE AFAIK.


Re: CSS background competing selectors question

Quoted text here. Click to load it

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

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.


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

Re: CSS background competing selectors question

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.


Site Timeline