CSS Flashcards

1
Q

What is a CSS module?

A

A CSS Module is a CSS file in which all class names and animation names are scoped locally by default.

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

How is width calculated with and without box-sizing: border-box?

A

Without: margin + width + border + padding

With: margin + width

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

What is the nearest ancestor parent to an element with position: absolute?

A

Whatever closest parent has a position property that is not static (i.e., anything that is relative | absolute | fixe | sticky).

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

What is the nearest ancestor parent to an element with position: fixed?

A

It is always the viewport, regardless of the position value of any parent elements.

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

What is the difference between moving an element using margin-left: 50% and transform: translateX(50%)?

A

Using margin moves the element left by 50% of the container width. translateX does the same but by 50% of the element’s width.

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

What would happen if we applied the following property to a grid?

grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));

A

It would create three columns within the grid.

Using minmax, each column can have a minimum width of 200px but, if room allows, can expand.

Using auto-fill, the grid will fit as many columns as possible into a row so long as they follow the rule established by minmax.

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