css-positioning Flashcards

1
Q

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

A

Normal flow = each block-level element sits on top of the next one
CSS - {position: static; }

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

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

A

no effect - This does not affect the position of surrounding elements; they stay in the position they would be in normal flow.

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

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

A

This moves an element from the position it would be in normal flow, shifting it to the top, right, bottom, or left of where it would have been placed.

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

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

A

It is taken out of normal flow, meaning that it does not affect the position of any surrounding elements (as they simply ignore the space it would have taken up).

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 where it appears on the page?

A

Absolutely positioned elements move as users scroll up and down the page

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

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

A

Absolutely positioned elements position themselves within the first non-static ancestor they have. Parent container, make position relative

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

What are the four box offset properties?

A

top bottom left right

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