css-positioning Flashcards
What is the default value for the position property of HTML elements?
Normal or static
How does setting position: relative on an element affect document flow?
Does not affect the position of other elements
How does setting position: relative on an element affect where it appears on the page?
Going to be relative to its original position in normal flow
How does setting position: absolute on an element affect document flow?
Element is removed, like it floats.
How does setting position: absolute on an element affect where it appears on the page?
It will allow it to reposition itself top left to the first parent it finds. If it’s already contained, it is going to reposition itself against any non-static parent.
How do you constrain an absolutely positioned element to a containing block?
By setting anything other than static.
What are the four box offset properties?
Top, bottom, left, right