Forum Moderators: not2easy

Message Too Old, No Replies

Certain Style Not Working

certain td style not working

         

Electric Mike

7:53 pm on Sep 4, 2009 (gmt 0)

10+ Year Member



Hello,
Please consider these 2 styles I made:

tdPrimaryColor { background-color: #9c0000 }
-Works as intended

tdSecondaryColor { background-color: #004891 }
-Does not work

Can anyone tell me why tdSecondaryColor wouldn't be working?

Thanks,
Mike

rocknbil

8:55 pm on Sep 4, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Welcome aboard Electric Mike, if that is your CSS verbatim, it's because you are assigning a style to an element "tdPrimaryColor" and no such element exists. :-)

If you want an element assigned only to a td with the class PrimaryColor,

td.primaryColor {}

<td class="PrimaryColor">.....

But if you want to repurpose that class for any element of the class "PrimaryColor",

.primaryColor {}

<td class="PrimaryColor">.....
<p class="PrimaryColor">.....
<div class="PrimaryColor">.....

-Works as intended

If the CSS you posted is in error and I've just told you what you already know, is it possible you are rendering in Quirks mode? (I.E., document doesn't validate, or maybe contains other errors?)

Not a web safe color?

Electric Mike

3:40 pm on Sep 7, 2009 (gmt 0)

10+ Year Member



Hi rocknbil,
THanks very much for the answer. I think I'm going to have to learn a bit more about the wonderful world of css!
Mike