Previous Message
Next Message

Contextual selector plus explicit class

Sent by Adam Kuehn on 15 March 2006 23:11

James Eaton wrote:
>What are the rules regarding contextual selectors used in combination with
>explicit class declarations?  I'm trying to use something like the
>following, but a class set in the <td> element has no effect (in Firefox
>and IE6):
>.stats td {
>   padding: 2px;
>   }
>.calign {
>   text-align: center;
>   }
><table class="stats">
>   <tr>
>     <th>Score</th>
>     <td class="calign">725</td>
>   </tr>

The selector .stats td has specificity [1] of 0,0,1,1.  The selector 
..calign has specificity of 0,0,1,0.  In other words, the first 
selector is "winning", and your second selector is not getting applied.

Try using .stats td.calign as your selector, instead.  This has 
specificity of 0,0,2,1 and should therefore solve your problem 
(assuming I have understood the issue correctly).

1. <>


-Adam Kuehn 

css-discuss [EMAIL-REMOVED]]
IE7b2 testing hub --
List wiki/FAQ --
Supported by --
Previous Message
Next Message

Message thread: