Getting ready

Imagine that we have two styles of links, one that is for our general content and another that is, specifically, for our navigation. We really want to be certain that these links are styled the same way, except for their coloring. We could write these as two different selectors, but that could duplicate a lot of styling CSS that would be easier to share as a common style:

a {  font-size: 14px;  text-decoration: underline;  color: #666;}nav a {  font-size: 14px;  text-decoration: underline;  color: #585858;}

Alternatively, we could rely, instead, on CSS's cascading effect. This reduces duplication, but might be prone to specificity mistakes if we aren't mindful of all the other selectors in our application:

a {  font-size: 14px;  text-decoration ...

Get MEAN Cookbook now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.