Styles applied to this page:
p.test1:first-letter {color: green; font-size: 200%;} p.test1 {color: gray; font-size: 1em;} p.test2 {color: gray; font-size: 1em;} p.test2:first-letter {color: green; font-size: 200%;}
This paragraph has a class
of test1
, and its text should be gray. This should apply to the first letter, whose rule has a specificity equal to the p.test
rule.
This paragraph has a class
of test2
, and its text should be gray. This should apply not to the first letter, whose rule has a specificity equal to the p.test
rule, and which comes later in the stylesheet.