CSS background competing selectors question

D

Derek Clarkson

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

rf

Derek Clarkson said:
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.
 
S

Steve Pugh

rf said:
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
 
D

Derek Clarkson

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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Staff online

Members online

Forum statistics

Threads
473,734
Messages
2,569,441
Members
44,832
Latest member
GlennSmall

Latest Threads

Top