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.

HTML
<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

ClassCSS declarations
staticposition: static;
relativeposition: relative;
absoluteposition: absolute;
fixedposition: fixed;
stickyposition: sticky;
View full generated CSS
Compiled CSS
.absolute {
  position: absolute;
}
.fixed {
  position: fixed;
}
.relative {
  position: relative;
}
.static {
  position: static;
}
.sticky {
  position: sticky;
}