CSS Positioning Flashcards

1
Q

What is the default value for the position property of HTML elements?

A

<b>Static</b> (which is a <i>value</i> of normal document flow)

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

How do you constrain an absolutely positioned element to a containing block?

A

The containing block itself has to have a position of a non-static value (relative, absolute, or fixed)

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

What are the four box offset properties?

A

Top, right, bottom, left

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

How does setting position: relative on an element affect document flow?

A

It doesn’t.

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

How does setting position: absolute on an element affect document flow?

A

Removed from document flow. Other elements will treat it like it no longer exists.

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

How does setting position: absolute on an element affect where it appears on the page?

A

It will appear on the first parent that is non-static. If there is none, then it’ll be the viewport. It sits on its own layer separate from the page.

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

How does setting position: relative on an element affect where it appears on the page?

A

It doesn’t. It’s self-contained.

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