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?
It does not affect the document flow, the surrounding elements stay positioned where they would normally be in.
How does setting position: relative on an element affect where it appears on the page?
It moves the element relatively from where it would be.
How does setting position: absolute on an element affect document flow?
It removes the elements from the document flow as it doesn’t exist.
How does setting position: absolute on an element affect where it appears on the page?
The element attaches itself to the first non-static containing parent.
How do you constrain an absolutely positioned element to a containing block?
Using position: non-static in the containing block.
What are the four box offset properties?
Top, bottom, left and right.