Position in css and position in css
I. position syntax and StructurePosition Syntax:Position: static absolute relative
Position parameter:
Static: No special positioning. Objects follow HTML positioning rules.
Absolute: Drag an object out of the Document Stream and use left, right, top, bottom, and other attributes for absolute positioning. Its stack is defined by the css z-index attribute. At this time, the object does not have margins, but still has padding and border
Relative: The object cannot be stacked, but it will be offset in the normal Document Stream Based on the left, right, top, bottom and other attributes.
Ii. Absolute positioning conditions of use
Position: absolute;Position: relativeAbsolute positioning uses the parent-Level Definition of position: relative positioning, child-Level Definition of position: absolute positioning attribute, and child-level use left, right, top or bottom for absolute positioning.
Iii. Summary of absolute css positioning
Absolute positioning if the parent class does not use position: relative, but directly uses position: absolute for absolute positioning, the body label will be used as the parent class, and position: no matter how many layers of DIV structure the absolute definition object is located, it will be dragged out to the <body> level as the parent level (reference level) for absolute positioning.
In absolute positioning, we can use css z-index to define the overlapping sequence of css layers.