- Positioning
Positioning = positioning mode + edge offset
static
Static positioning
relative
Relative positioning
absolute
Absolute positioning
fixed
Fixed positioning
The edge offset has top bottom left right
1. Static positioning static (understand) the
default positioning method of the element has no meaning of positioning, as the standard flow element has no edge offset. It is rarely used
. 2. The relative
relative positioning position is moved and the original position is
retained. 3.
Absolute absolute positioning if there is no parent element or no parent element Positioning is based on the browser as the positioning mobile location
If the parent element is positioned, move the position based on the nearest parent element with positioning
Absolute positioning no longer occupies the original position
Son and father
4.Fixed
fixed positioning is subject to the browser visual window. It
has nothing to
do with the parent element. It does not follow the scroll bar
and does not occupy the original position after being fixed.
5.sticky
positioning