CSS2 Test Suite: 6.4.3 Calculating specificity

[index page] [section] [Previous] [Next] [Specification]

The style declarations contained within this page:

* {color: red;}  /* a=0 b=0 c=0 -> specificity =   0 */
LI  {color: maroon;}  /* a=0 b=0 c=1 -> specificity =   1 */
UL LI {color: green;}  /* a=0 b=0 c=2 -> specificity =   2 */
H1 + *[REL=up] {color: purple;}  /* a=0 b=1 c=1 -> specificity =  11 */
UL OL LI.olive {color: olive;}  /* a=0 b=1 c=3 -> specificity =  13 */ 
LI.olive.level {color: olive; font-weight: bold;}
   /* a=0 b=2 c=1 -> specificity =  21 */
#x34y {color: lime;}  /* a=1 b=0 c=0 -> specificity = 100 */ 




Although this unstyled paragraph, and many other elements on this page, may be red, this is acceptable. For example, the text "No inheritance tests for this property" should be red.

[x34y] This paragraph should be lime.

An H1 element

[rel=up] This paragraph should be purple.


[index page] [section] [Previous] [Next] [Specification]