css-box-model Flashcards

1
Q

What CSS properties make up the box model?

A

The CSS properties that make up the box model are border, margin, padding, width, height. By default border-box is set to content-box which makes the border, margin, and padding increase the width and height. Border-box can be set to box-sizing to make the width and height the final dimensions of the box.

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

Which CSS property pushes boxes away from each other?

A

The CSS property that pushes boxes away from each other is margin. When there are two competing margins from elements that touch each other, the greater one is used and the lesser one is removed. If two margin values are the same and they are competing, only one will be used.

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

Which CSS property add space between a box’s content and its border?

A

The CSS property that adds space between a box’s content and its border is padding. Background color will cover the extra space taken up by padding. Adding padding around text blocks increases readability.

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