css-positioning Flashcards
What is the default value for the position property of HTML elements?
Static
How does setting position: relative on an element affect document flow?
no effect on document flow; there is still the gap where the element would have been
How does setting position: relative on an element affect where it appears on the page?
Does not affect inherently where it appears on the page; visually moves an element in relation to where it would have been in normal flow, can overlap other elements
How does setting position: absolute on an element affect document flow?
removed from document flow; may or may not have an effect on other elements; the gap where the element should be is gone and it sits on its own layer, separate from anything else
How does setting position: absolute on an element affect where it appears on the page?
moves to top left to whichever parent is non-statically positioned (or the body if there are none)
How do you constrain an absolutely positioned element to a containing block?
They need to be within a non-static parent
What are the four box offset properties?
Top, bottom, left, right