Testing Statement #5 Below of Section 3.2 of CSS1 Spec
5. Sort by specificity of selector: more specific selectors will override more
general ones. To find the specificity, count the number of ID attributes in the
selector (a), the number of CLASS attributes in the selector (b), and the
number of tag names in the selector (c). Concatenating the three numbers gives
the specificity.
PASS CRITERIA:
If statement #5 above is passed, then:
-
This list item is blue; the rule applied is "li {color: blue}", which has
a specificity of 1
-
This list item is green; the rule applied is "ul li {color: green}", which
has a specificity of 2
-
This list item is gray; the rule applied is "ul ol li {color: gray}", which
has a specificity of 3
-
This list item is red; the rule applied is "li.red {color: red}, which
has a specificity of 11
-
This list item is italic; the rule applied is "ul ol li.ita {font-style;
italic}", which has a specificity of 13.
This h3 heading is purple; the rule applied is "#id1 {color: purple}", which
has a specificity of 100.
This h4 heading has a first letter of 48pt and a first line of 36pt. The
rest of it should be UA-default. It has a specificity of 1.
NOTE: The link below should be lime. The pseudo-class applied is
"A:link {color: lime}".
The specificity is 11.
To move directly to the next test, click here