Fixed Positioning Flashcards
What is a positioned element?
A positioned element is one that have had its position property changed from its default values.
What is positioning?
Positioning governs how elements are laid on a page and how the position adjusting properties of top, right, bottom and left affect elements.
Give the values of the CSS position property.
- Static ( The default)
- Fixed
- Absolute
- Relative
What position properties does flexbox reduce the use case of?
Absolute and relative.
Give four points explaining static elements.
- It is the default for all elements.
- It means that elements follow the “flowing text” model of layout.
- It totally ignores the position adjusting properties of top, right, bottom and left.
- The only properties that influence it are margins, paddings, floats, and display properties such as block, inline, inline-block, etc
Give all the characteristics you know of fixed elements.
- Fixed elements totally respect the position adjusting qualities of top, right, bottom and left.
- Fixed elements stick to the top, bottom, or side of the page and will not scroll with the rest of the page.
- Fixed elements do not contribute to the size of their parent.
- Unlike static and relative positioned block level elements which take the width of their parent container, fixed and absolute block elements do not and in fact, the initial width of a fixed element is its content area although that can be changed.
- Unlike static and relative block elements where margins can be used to adjust an element and keep neighboring siblings away, fixed and absolute elements cannot use the margin property to keep neighboring siblings away to fight crowding.
- Fixed and absolute elements can use the position adjusting properties of top, right, bottom and left to size an element and leave the dimensional properties of width and height unchanged and the fixed positioned (or absolute positioned) element will grow or shrink based on the size of the window.
NOTE: This feature is only available to fixed and absolute positioned elements.
What is fixed positioning?
Fixed positioning places an element in a location that is relative to the browser window (rather than the page) hence fixed elements never move!
What is a fixed positioned element?
A fixed positioned element is an element that has been placed against the viewport and will not scroll with the rest of the page.