css-cascade Flashcards
What are the four components of “the Cascade”.
The four components of “the Cascade” are: specificity, source order, the important rule, and inheritance.
What does the term “source order” mean with respect to CSS?
The term “source order” with respect to CSS means the further down a ruleset is defined in a stylesheet, the higher precedence it has to be applied to an element if they have the same specificity.
How is it possible for the styles of an element to be applied to its children as well without an additional CSS rule?
It is possible for styles of an element to be applied to its children as well without an additional CSS rule if it is a normally inheritable style. Font-family can be applied to the body and all its children will have the same font. Border is never inherited by children.
List the three selector types in order of increasing specificity.
The three selector types in order of increasing specificity are: tag, class, id.
Why is using !important considered bad practice?
The !imporant is bad to use because it is too powerful and once you use it, there is no way to change the style of a similar element besides using !important again. It breaks all the rules of the stylesheets.