Position
.absolute
.absolute
Sets the position property to absolute
, positioning the element relative to its nearest positioned ancestor.
CSS equivalent: position: absolute;
Example usage:
.relative
.relative
Sets the position property to relative
, positioning the element relative to its normal position.
CSS equivalent: position: relative;
Example usage:
.fixed
.fixed
Sets the position property to fixed
, positioning the element relative to the viewport.
CSS equivalent: position: fixed;
Example usage:
.static
.static
Sets the position property to static
, placing the element in its default position according to the normal flow of the document.
CSS equivalent: position: static;
Example usage:
.sticky
.sticky
Sets the position property to sticky
, positioning the element based on the user's scroll position, but behaves like relative
until it reaches a specified threshold.
CSS equivalent: position: sticky;
Example usage:
These utility classes provide different positioning options for elements, allowing you to control their placement within the document layout.
Last updated