css-positioning Flashcards

1
Q

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

A

The default value for the position property of HTML elements is static. This is what creates “normal” document flow.

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

Setting position:relative on an element has no affect on the document flow and only on the appearance of the elements position on the page.

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

Setting position: relative on an element does not affect where it appears on the page. Adding offset elements such as: top, bottom, left, right will change the position of the element on the page without taking it out of document flow.

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

Setting position: absolute on an element takes the element out of the document flow. The position is now relative to the nearest non-statically positioned parent. One trick is setting the parent display to relative to make the absolute position offset elements target the parent element.

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

Setting position: absolute on an element makes it appear on top of the page and other elements will sit underneath it and might be covered by the absolute element.

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

To constrain an absolutely positioned element you want to make the parent display a non-static display. This is typically done by making the parent display: 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

The four box offset properties are; top, right, bottom, left.

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