"1"
When we want to use absolute positioning, there must be two conditions
1 "The parent element must be positioned with the attribute, it is generally recommended to use position:relative (that is, to set the parent element relative positioning);
2 "to the child elements, plus absolute positioning position:absolute (to the child element is set to absolute positioning); Simultaneous plus direction attribute (top, Left,rigth,bottom)
Absolute positioning is the positioning of the parent element as a datum point (if he does not have a parent element, or if its parent element does not have the Position:relative property set) it will be positioned as a datum point for <body>. Absolute positioning is out of the document flow (ie: he floats, no longer occupies the original position)
Absolute Positioning
<! DOCTYPE html>
2 To add absolute positioning to the child elements, not to add relative positioning to the parent element, then the absolute positioning of the child element is the body as a benchmark for positioning<! DOCTYPE html>
3 Finally, to add relative positioning to the parent element, to add absolute positioning to the child elements, then the absolute positioning of the child element is the parent element as the benchmark to locate the "<! DOCTYPE html>
Absolute positioning Position:absolute, relative positioning position:relative