MudGuard: Hover effekt mit css spuckt :(

Beitrag lesen

Hi,

#nav li a ist spezifischer als #nav:hover a

Ist das so?
1. count 1 if the declaration is from is a 'style' attribute rather than a rule with a selector, 0 otherwise (= a)

ergibt 0 für beide.

2. count the number of ID attributes in the selector (= b)

ergibt 1 für beide

3. count the number of other attributes and pseudo-classes in the selector (= c)

ergibt 0 für den ersten, 1 für den zweiten Selector.

4. count the number of element names and pseudo-elements in the selector (= d)

ergibt 2 für den ersten, 1 für den zweiten Selector.

5. Concatenating the four numbers a-b-c-d (in a number system with a large base) gives the specificity.

0-1-0-2 bzw. 102 für den ersten, 0-1-1-1 bzw. 111 für den zweiten.

Damit ist der zweite, also '#nav:hover a', spezifischer, da 111 > 102.

cu,
Andreas

--
Warum nennt sich Andreas hier MudGuard?
O o ostern ...
Fachfragen per Mail sind frech, werden ignoriert. Das Forum existiert.