Absolute position: absolute; relative position: relative, absoluterelative
1
When we want to use absolute positioning, we must have two conditions.
1 "must add a positioning attribute to the parent element. Generally, it is recommended to use position: relative (that is, set the parent element to relative positioning );
2. Add absolute position: absolute to the child element (set absolute position for the child element), and add the direction attribute (top, left, rigoal, bottom)
Absolute positioning is based on the parent element (if it does not have a parent element, or its parent element does not have the position: relative attribute set) it is located based on <body>. The absolute positioning will be out of the Document Stream (I .e., it will float and no longer occupy the original position)
Absolute Positioning
<!DOCTYPE html>
2. Add absolute positioning to the child element. If relative positioning is not added to the parent element, the absolute positioning of the child element is based on the body.
<! DOCTYPE html>
3. Finally, add relative positioning to the parent element and add absolute positioning to the child element. Then, the absolute positioning of the child element is based on the parent element.
<! DOCTYPE html>