Home/Utilities/Position

Position

Positioning, inset, and float utilities - all with responsive variants.

Position values

Set the CSS position property on any element. Both shorthand and .pos-{value} forms are generated.

<div class="relative">
  <div class="absolute">Positioned inside relative parent</div>
</div>

<nav class="fixed">Fixed nav</nav>
<header class="sticky">Sticky header</header>
ClassAliasCSS
.static.pos-staticposition: static
.relative.pos-relativeposition: relative
.absolute.pos-absoluteposition: absolute
.fixed.pos-fixedposition: fixed
.sticky.pos-stickyposition: sticky

Offset (top / right / bottom / left)

Inset utilities on the spacing scale, matching padding, margin, and gap. Values are rem-based; every class also accepts responsive prefixes such as md:top-6.

Preview

.top-15.right-15
.bottom-2.left-2
<!-- Pin every side -->
<div class="absolute inset-0">Overlay</div>

<!-- Offset a single side -->
<span class="absolute top-15 right-15">12px from the top-right</span>

<!-- Responsive offset -->
<div class="fixed top-3 md:top-6">Floating button</div>
ClassValue
.top-00
.top-050.25rem (4px)
.top-10.5rem (8px)
.top-150.75rem (12px)
.top-21rem (16px)
.top-31.5rem (24px)
.top-42rem (32px)
.top-52.5rem (40px)
.top-63rem (48px)

Swap top for right, bottom, or left to offset any single side, and use .inset-{n} to set all four at once. All classes accept responsive prefixes such as md:top-6.

Zero inset shorthands

These classes set the named sides to 0 - useful for pinning an overlay to a corner or edge without writing all four coordinates.

ClassSets to 0
.toptop: 0
.leftleft: 0
.bottombottom: 0
.rightright: 0
.top-lefttop: 0; left: 0
.top-righttop: 0; right: 0
.bottom-leftbottom: 0; left: 0
.bottom-rightbottom: 0; right: 0

Float

Float utilities and clearfix for legacy float-based layouts.

<div class="clearfix">
  <img class="float-left" src="..." alt="...">
  <p>Text wraps around the floated image.</p>
</div>
ClassCSS
.float-leftfloat: left
.float-rightfloat: right
.clearfixclear: both
Responsive variants. All position values support breakpoint prefixes - e.g. md:absolute, lg:sticky. Inset utilities also support responsive prefixes via breakpoint-from.