Box Model Flashcards

1
Q

What is the general rule of using units?

A

font-size: rem
padding & margin: em
width: em or %

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

How does the browser calculate em?

A

It becomes relative to the font-size of current element, when used on anything other than font-size. Font-size is calculated relative the parent’s font-size.

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

How does the browser calculate rem?

A

The font size of the root element: or :root.

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

What is the best unit of width: for a responsive design?

A

%

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

What is the difference between content-box and border-box in box-sizing property?

A

Content-box makes 100px width set the content box of an element to 100px.

Border-box will include the border and padding in the 100px of the element.

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

What are the four areas of an element’s box model, from the inside out?

A

Content, padding, border and margin.

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