CSS Unit 1 Flashcards

1
Q

Define CSS Cascade.

A

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”.

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

List the order in which CSS declarations cascade

A

Origin & Importance
Selector Specificity
Source Order
Initial & Inherited Properties (default values)

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

As far as Origin and Importance go list the 3 tiers of origin form Highest to Least. And what is “Importance”?

A

Author
User
User-Agent
“Importance” is used as a value “!important” to override any CSS in the algorithm

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

List in order Selector Specificity from highest to least.

A
Inline styles (anything inside a style tag)
ID selectors
Classes / pseudo-selectors
Type selectors (for example, h1) & pseudo-elements (::before)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Define CSS Source Order

A

If two selectors would have the same specificity, the declaration that came last wins!

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

Define Initial and Inherited properties

A

Inherited properties will trickle down from parent elements to child elements

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