css-cascade Flashcards

1
Q

What are the four components of “the Cascade”.

A

inheritance, source order, specificity,

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 order in which code is displayed in a style sheet

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

because of the inheritance property. mostly used for font stuff. browser put a lot of emphasis on making ealing w text easier. if there was no inheritance we would have to apply font styles to every text element.

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

TYPE > CLASS > ID

specificity: its basic math
a score based on whats included in your selector
0 -1 - 2 vs 0 - 2 - 0 , think of this as ones place tens place, hundreds etc
its based on how specifically your are targeting that element

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

it’s a cheat code that forces styling to supersede previous styling. and if you want to make changes to that, you will need to keep using !important

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