CSS Unit 1 Flashcards
Define CSS Cascade.
The CSS Cascade is the algorithm by which the browser decides which CSS styles to apply to an element — a lot of people like to think of this as the style that “wins”.
List the order in which CSS declarations cascade
Origin & Importance
Selector Specificity
Source Order
Initial & Inherited Properties (default values)
As far as Origin and Importance go list the 3 tiers of origin form Highest to Least. And what is “Importance”?
Author
User
User-Agent
“Importance” is used as a value “!important” to override any CSS in the algorithm
List in order Selector Specificity from highest to least.
Inline styles (anything inside a style tag) ID selectors Classes / pseudo-selectors Type selectors (for example, h1) & pseudo-elements (::before)
Define CSS Source Order
If two selectors would have the same specificity, the declaration that came last wins!
Define Initial and Inherited properties
Inherited properties will trickle down from parent elements to child elements