Choose the positioning scheme: static, relative, absolute, fixed or sticky. This family contains 5 generated classes in Nakshora 3.1.
Classes#
| Class | Generated CSS |
|---|---|
static | position: static; |
fixed | position: fixed; |
absolute | position: absolute; |
relative | position: relative; |
sticky | position: sticky; |
Example#
example
<div class="relative">
<span class="absolute top-0 right-0 badge">NEW</span>
</div>Responsive & variants#
Every class here accepts screen prefixes (xxs: … 5xl:) and state variants — md:hover:p-4 style stacks compile to a single media query. See responsive/index|Responsive design and variants/index|Variants.
Best practices#
relativeon the parent establishes the containing block forabsolutechildrenstickyneeds a scroll container and an inset utility liketop-0
Common mistakes#
absolutewithout a positioned ancestor escapes to the viewport-sized initial containing blockstickyinside anoverflow: hiddenparent never sticks
Related#
utilities/spacing/margin|Margin · utilities/sizing/width|Width · responsive/index|Responsive
