Research and Documentation
Page 03: Specificity and Accessibility

What is CSS specificity?

CSS specificity determines which CSS properties have the highest priority. Within a given CSS document, for a given element or class, the last duplicate property or declaration has the highest priority, unless a different duplicate property or declaration is tagged with !important (this practice, of course, is highly discouraged). For this reason, the anchor tag pseudo-classes must always ordered as follows:

  1. :link
  2. :visited
  3. :hover
  4. :focus
  5. :active

What are contrast ratios?

A contrast ratio indicates the contrast of one color relative to the contrast of another color. You can see the contrast ratio of an HTML element using your browser's developer tools.

Why must I meet contrast ratio requirements?

If your website fails to meet contrast ratio requirements, you or your company may be sued over accessibility.

Who sets accessibility rules for the World Wide Web?

Accessibility rules for the World Wide Web are set by the Web Accessibility Initiative (WAI). These rules are listed under the Web Content Accessibility Guidlines (WCAG).

Summary

This documentation page includes information about the following: