Position
Position utilities set the CSS position property. Coordinate properties (top, left, etc.) are not generated -- supply them with custom properties or a scoped style.
Position values
Available classes: position-static, position-relative, position-absolute, position-fixed, and position-sticky.
index.htmlhtml
<div class="position-relative border rounded-sm p-3 mb-3">
<p>This container is <code>position-relative</code>.</p>
<p>Absolutely positioned children are anchored to it.</p>
</div>
<p class="bg-surface-raised rounded-sm p-2">A <span class="position-relative bg-surface-raised rounded-sm px-1">relatively positioned inline span</span> stays in flow.</p>This container is position-relative.
Absolutely positioned children are anchored to it.
A relatively positioned inline span stays in flow.
Reference
| Class | Property | Responsive |
|---|---|---|
.position-static | position: static | No |
.position-relative | position: relative | No |
.position-absolute | position: absolute | No |
.position-fixed | position: fixed | No |
.position-sticky | position: sticky | No |