Position Component

Fixed / absolute centering, corner anchoring, and sticky offsets using logical properties.

Notes

Interactive fixed / absolute

Switch the target between fixed and absolute to see how it anchors to the viewport vs. the parent box.

Target

Cover

absolute-cover — fills the parent

absolute-cover

absolute-cover-4 — cover with dynamic gap

absolute-cover-4

absolute-cover-x

x

absolute-cover-y

y

absolute-cover-x-4

x-4

The same fixed-cover / fixed-cover-x / fixed-cover-y variants fill the viewport instead of the parent.

Centering

absolute-center

center

absolute-center-x

center-x

absolute-center-y

center-y

The same fixed-* variants anchor to the viewport instead of the parent.

Corner anchors

top-start top-end bottom-start bottom-end

Fixed variants (fixed-top-start fixed-top-end fixed-bottom-start fixed-bottom-end) behave the same but stick to the viewport.

Sticky

sticky-top

Header
Line 1
Line 2
Line 3
Line 4
Line 5
Line 6
Line 7
Line 8
Line 9
Line 10

sticky-bottom

Line 1
Line 2
Line 3
Line 4
Line 5
Line 6
Line 7
Line 8
Line 9
Line 10
Footer

sticky-top-4 (offset)

Top-4
Line 1
Line 2
Line 3
Line 4
Line 5
Line 6
Line 7
Line 8
Line 9
Line 10