test pages: key concepts - specificity
Tutorials Bugs Masterclass Free stuff Test pages Proposals

Core tests

Advanced tests

This test tests: specificity

Note that this only tests class and ID; tests of other selectors are to be found in the selectors section.

Should be red

  1. P.class {color: red} .class {color: blue}

  2. DIV.class3 .class4 {color: red} .class3 DIV {color: blue}
  3. .class .class .class .class .class .class .class .class .class .class {color: blue} #id3 {color: red}
  4. DIV#id5 {color: red} .class .class .class .class .class .class .class .class .class .class {color: blue}
  5. .class2 {color: red} ADDRESS {color: blue}

Should be blue

  1. #id4 {color: red} .class .class .class .class .class .class .class .class .class .class {color: blue}