CSS-positioning-Q&A Flashcards

1
Q

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

A

The default position is static for any html element if not specified explicitly.

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

Relative positioning moves an element in relation to where it would have been in normal flow. For example, you can move it 10 pixels lower than it would have been in normal flow or 20% to the right.

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

It will have no effect on it’s positioning at all

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

An absolutely positioned element no longer exists in the normal document flow.

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

It sits on its own layer separate from everything else.

It will align itself with the first non-static positioned parent.

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

You would set position relative to the parent element

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, left, bottom and right.

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