Browse documentation
Reference / Layout
Position
Use a positioned parent to anchor a label inside a card, or pin a heading within its nearest scrolling container.
Working example
Absolute children use the nearest positioned ancestor as a reference. Sticky positioning also needs an offset such as top-0.
<article class="relative border p-4 pt-10">
<span class="absolute top-2 right-2 bg-black px-2 text-xs text-white">New</span>
<h3 class="font-semibold">Field recordings</h3>
</article>Class reference
| Class | CSS declarations |
|---|---|
static | position: static; |
relative | position: relative; |
absolute | position: absolute; |
fixed | position: fixed; |
sticky | position: sticky; |
View full generated CSS
.absolute {
position: absolute;
}
.fixed {
position: fixed;
}
.relative {
position: relative;
}
.static {
position: static;
}
.sticky {
position: sticky;
}