|
Posted by Roy A. on 01/20/07 19:26
Ben C skrev:
> > According to these rules, putting these classes in a certain order in
> > the stylesheet doesn't make sense. By using an element name before the
> > pseudo-class, e.g. a:active, would ensure that this style take
> > precedence. But, is there any default cascading order for these
> > classes? I suspect it is vendor specific.
>
> It's all specified, see 6.4.1. You sort by origin, then by specificity,
> and finally by the order in which they appeared. There should be always
> one and only one right answer for what styles an element should get from
> the cascade.
Ah, I see. Given <a href="#">link</a> and
:active { color: black } :hover { color: lime }
the latter wins.
Similarly. Given <td class="no_left_border left_border"> and
..left_border {border-left: 1px solid}
..no_left_border {border-left: 0px solid}
the latter (in the stylesheet) wins.
Now it make sense to me to.
[Back to original message]
|