Home>Article>Web Front-end> What does position mean?
#position attributeSpecifies the positioning type of the element. This attribute defines the positioning mechanism used to establish the layout of the element. Any element can be positioned, but absolute or fixed elements generate a block-level box, regardless of the type of the element itself. A relatively positioned element is offset from its default position in normal flow.
Value
static
Default value. There is no special positioning, the object follows HTML positioning rules (ignoring top, bottom, left, right or z-index declarations).
absolute
Drag the object out of the document flow, using left, right, top, bottom and other properties relative to the closest one with the most positioning settings The parent object is positioned absolutely. If no such parent object exists, the body object is used. The cascading defined through the z-index attribute
fixed
is not supported. Object positioning follows the absolute method. However, some specifications must be followed
relative
Objects cannot be stacked, but will be offset in the normal document flow based on left, right, top, bottom and other attributes
Related recommendations: "CSS Tutorial"
The above is the detailed content of What does position mean?. For more information, please follow other related articles on the PHP Chinese website!