September 2017
Intermediate to advanced
450 pages
11h 24m
English
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 ...
Read now
Unlock full access