Box Model Flashcards

1
Q

From outside to inside, what is the order of the css properties that affect a box’s dimensions

A
  1. margin
  2. border
  3. padding
  4. content (i.e. width / height)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

How far do background-images and background-colors extend in the box model?

A

The image and colors will extend through the content to the border unless this default behavior is adjusted with the background-clip property

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

Does each box have its own margin?

A

No, margins can be “shared” when adjacent to another box. This is called margin collapsing.

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

How do an adjacent top and bottom margin “collapse?”

A

Top and bottom margins will be collapse using the following calculations:

  1. The largest individual margin size will be used
  2. If the margins are equal, only one margin will be used
How well did you know this?
1
Not at all
2
3
4
5
Perfectly