Box Model Flashcards

1
Q

What is the fundamental concept of CSS layout?

A

Everything displayed by CSS is a box.

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

What are the main factors that affect a box’s behavior?

A

display value, set dimensions, and content.

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

What are the two types of sizing in CSS?

A

Extrinsic sizing (specified size) and intrinsic sizing (browser’s default behavior).

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

How does intrinsic sizing work?

A

The browser makes decisions based on content size, using properties like min-width to ensure the box is at least as wide as the content’s minimum width.

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

What happens when content is too large for its container?

A

Overflow occurs.

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

How can you manage overflow in CSS?

A

Using the overflow property to control how content behaves when it exceeds its container.

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

What are the four areas of the CSS box model?

A

Content box, padding box, border box, and margin box.

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

What is the role of the content box?

A

It is where the content lives and can influence the parent’s size.

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

What is the padding box?

A

The area surrounding the content, created by the padding property, and inside the box’s background.

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

What defines the border box?

A

The space around the padding box, defined by the border value.

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

What is the margin box?

A

The space around the entire box, set by the margin property.

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

Which properties do not affect a box’s size?

A

outline and box-shadow.

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

What is the purpose of a user agent stylesheet?

A

It defines default styles for elements if no custom CSS is applied.

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

How do inline elements behave in the box model?

A

They respect block margins, but other elements do not respect their margins, and they only grow as large as their content.

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

How do block elements behave in the box model?

A

They fill the available inline space by default.

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

What does the box-sizing property do?

A

It determines how the box calculates its size.

17
Q

How does content-box sizing work?

A

Width and height apply only to the content box, while padding and border increase the total size.

18
Q

How does border-box sizing work?

A

The specified width includes the content, padding, and border, pushing the padding and border inside.