Position
The position class sets the position property. It determines how the element is positioned in the document.
| CSS Shortcut class | Applied style |
|---|---|
|
|
|
|
|
|
|
|
|
|
Examples
Static
position-static
<p class="position-static">
This element displays a static position where it exists in the normal document flow.
</p>
Absolute
position-absolute
<p class="position-absolute">
This element is removed from the normal document flow and displays relative to its nearest positioned ancestor or the page itself.
</p>
Fixed
position-fixed
<p class="position-fixed">
This element displays relative to the viewport and stays fixed in place when the page is scrolled.
</p>
Relative
position-relative
<p class="position-relative">
This element is offset relative to its normal position using top, right, bottom, or left.
</p>
Sticky
position-sticky
<p class="position-sticky">
This element scrolls with the page until a specified offset is reached, then sticks in place within its containing block.
</p>
xs:> 480pxsm:> 640pxmd:> 768pxlg:> 1024pxxl:> 1280px
<div class="xs:position-relative ...">
...
</div>