css-cascade Flashcards

1
Q

What are the four components of “the Cascade”.

A

The four components of “the Cascade” are: specificity, source order, the important rule, and inheritance.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What does the term “source order” mean with respect to CSS?

A

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 well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

How is it possible for the styles of an element to be applied to its children as well without an additional CSS rule?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

List the three selector types in order of increasing specificity.

A

The three selector types in order of increasing specificity are: tag, class, id.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Why is using !important considered bad practice?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly