Skip to main content

Top / Right / Bottom / Left

Utilities for controlling the placement of positioned elements.

CSS Property:top, right, bottom, left, inset
Classes:38

Top / Right / Bottom / Left Classes

ClassCSS
inset-0inset: 0;
inset-pxinset: 1px;
inset-0.5inset: 0.125rem;
inset-1inset: 0.25rem;
inset-2inset: 0.5rem;
inset-4inset: 1rem;
inset-autoinset: auto;
inset-x-0left: 0; right: 0;
inset-y-0top: 0; bottom: 0;
start-0inset-inline-start: 0;
end-0inset-inline-end: 0;
top-0top: 0;
top-pxtop: 1px;
top-1top: 0.25rem;
top-2top: 0.5rem;
top-4top: 1rem;
top-autotop: auto;
right-0right: 0;
right-1right: 0.25rem;
right-2right: 0.5rem;
right-4right: 1rem;
right-autoright: auto;
bottom-0bottom: 0;
bottom-1bottom: 0.25rem;
bottom-2bottom: 0.5rem;
bottom-4bottom: 1rem;
bottom-autobottom: auto;
left-0left: 0;
left-1left: 0.25rem;
left-2left: 0.5rem;
left-4left: 1rem;
left-autoleft: auto;
inset-1/2inset: 50%;
inset-fullinset: 100%;
-top-1top: -0.25rem;
-top-2top: -0.5rem;
-left-1left: -0.25rem;
-left-2left: -0.5rem;

Arbitrary Values

You can use arbitrary values with square bracket notation when you need a specific value not included in the default scale.

top-[10px]inset-[5%]-top-[2rem]

Responsive Variants

Apply top / right / bottom / left utilities at specific breakpoints using responsive prefixes.

BreakpointPrefixExample
640px+sm:sm:inset-0
768px+md:md:inset-0
1024px+lg:lg:inset-0
1280px+xl:xl:inset-0
1536px+2xl:2xl:inset-0