1.2 CSS Box Model Flashcards

1
Q

What does the CSS box model look like?

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

What does border mean?

A

It’s usually a thin edge just outside of
the main element, serves as a boundary.

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

What’s the difference between padding and margin?

A

Padding is inside the border.

Margin is outside the border.

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

What is the box?

A

The box is the content.

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

When do you use padding?

A

When space is needed immediately
around a specific element.

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

Are paddings and margins used together?

A

Yes

Most items tend to have a combination
of both margins and paddings.

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

Can margins be used between elements?

A

Yes, margin can be applied outside to separate elements.

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

Why is the box model important?

A

Every web page is composed of nothing but boxes.

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

What about circles, triangles, and abstract,
do they appear as boxes to the browser?

A

From browser POV, every item has the box shape, regardless of how the content appears to the end user.

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

What happens if the content is missing padding?

A

It looks wrong.

It needs more white space in relation to other elements.

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

What’s happening in this image when it’s margin only?

A

There is margin keeping elements apart,
but the content itself is lacking space.

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

Does adding borders, margins, and padding change dimensions?

A

Yes

Every facet adds to the total dimension of the content.

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

Can margins hold negative values?

A

Yes

Margins can be negative.

Paddings cannot.

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

Can the value of padding be set to auto?

A

No, padding cannot accept auto as a value.

Only margins can be set to auto

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

What are the 4 ways that padding and margin improve UI?

A

An effective use of white space is important to ensure

  • *focus,**
  • *readability,**
  • *hierarchy,**and
  • *understanding.**
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Should you use margin or padding in place of the other?

A

No

Padding and margins were never meant to be used interchangeably.

17
Q

What’s the dimension of the content?

A

Content size is determined by width and length.

18
Q

What properties impact the depth of padding?

A

The thickness of the padding is determined by the padding-top, padding-right, padding-bottom, padding-left, and shorthand padding properties.

19
Q

What properties control border area depth?

A

The thickness of the borders are determined by the border-width and shorthand border properties.

20
Q

What properties control the size of margins?

A

The size of the margin area is determined by the margin-top, margin-right, margin-bottom, margin-left, and shorthand margin properties.

21
Q

Why do margins collapse?

A

When margin collapsing occurs, the margin area is not clearly defined since margins are shared between boxes.