The “Cascade” Effect in “Cascading Style Sheets”
Explanation of the “C” in “CSS” with specificity…
Of course there are “excuses” for inline CSS style declarations…that’s why we have them.
Are they misused? Of course.
HTML emails need to be constructed with inline styles…for those who have never tried….but alas, that is not why we have ‘em.
We have them to override those “special one-off” cases that do not require a global definition.
Use the “DRY Principle — Don’t Repeat Yourself”
- If you need an inline style, use it.
- If you re-use it on that page only, put it in the local stylesheet.
- If you use it on multiple pages, refactor it into your global css file.
There was no mention of “specificity” — which may be considered part of the cascade.
/* generalized style -- less specific */
ul { background-color: green; font-weight: bold; }
/* overrides more general styles -- but also inherits */
ul#nav.special { background-color: red; }



















