Layout

top to Tailwind

Offsets share the spacing scale with padding and margin, so top: 8px becomes top-2 on a 0.25rem base.

The 102 mappings below are read straight out of Tailwind v4.3.3, not maintained by hand, so this is what the converter will actually produce for top.

top values and their classes

CSSTailwind
top: -100%;-top-full
top: -91.666667%;-top-11/12
top: -83.333333%;-top-5/6
top: -80%;-top-4/5
top: -75%;-top-3/4
top: -66.666667%;-top-2/3
top: -60%;-top-3/5
top: -58.333333%;-top-7/12
top: -50%;-top-1/2
top: -41.666667%;-top-5/12
top: -40%;-top-2/5
top: -33.333333%;-top-1/3
top: -25%;-top-1/4
top: -24rem;-top-96
top: -20%;-top-1/5
top: -20rem;-top-80
top: -18rem;-top-72
top: -16.666667%;-top-1/6
top: -16rem;-top-64
top: -15rem;-top-60
top: -14rem;-top-56
top: -13rem;-top-52
top: -12rem;-top-48
top: -11rem;-top-44
top: -10rem;-top-40
top: -9rem;-top-36
top: -8.333333%;-top-1/12
top: -8rem;-top-32
top: -7rem;-top-28
top: -6rem;-top-24
top: -5rem;-top-20
top: -4rem;-top-16
top: -3.5rem;-top-14
top: -3rem;-top-12
top: -2.75rem;-top-11
top: -2.5rem;-top-10
top: -2.25rem;-top-9
top: -2rem;-top-8
top: -1.75rem;-top-7
top: -1.5rem;-top-6
top: -1.25rem;-top-5
top: -1px;-top-px
top: -1rem;-top-4
top: -0.875rem;-top-3.5
top: -0.75rem;-top-3
top: -0.625rem;-top-2.5
top: -0.5rem;-top-2
top: -0.375rem;-top-1.5
top: -0.25rem;-top-1
top: -0.125rem;-top-0.5
top: 0;top-0
top: 0.125rem;top-0.5
top: 0.25rem;top-1
top: 0.375rem;top-1.5
top: 0.5rem;top-2
top: 0.625rem;top-2.5
top: 0.75rem;top-3
top: 0.875rem;top-3.5
top: 1px;top-px
top: 1rem;top-4
top: 1.25rem;top-5
top: 1.5rem;top-6
top: 1.75rem;top-7
top: 2rem;top-8
top: 2.25rem;top-9
top: 2.5rem;top-10
top: 2.75rem;top-11
top: 3rem;top-12
top: 3.5rem;top-14
top: 4rem;top-16
top: 5rem;top-20
top: 6rem;top-24
top: 7rem;top-28
top: 8rem;top-32
top: 8.333333%;top-1/12
top: 9rem;top-36
top: 10rem;top-40
top: 11rem;top-44
top: 12rem;top-48
top: 13rem;top-52
top: 14rem;top-56
top: 15rem;top-60
top: 16rem;top-64
top: 16.666667%;top-1/6
top: 18rem;top-72
top: 20%;top-1/5
top: 20rem;top-80
top: 24rem;top-96
top: 25%;top-1/4
top: 33.333333%;top-1/3
top: 40%;top-2/5
top: 41.666667%;top-5/12
top: 50%;top-1/2
top: 58.333333%;top-7/12
top: 60%;top-3/5
top: 66.666667%;top-2/3
top: 75%;top-3/4
top: 80%;top-4/5
top: 83.333333%;top-5/6
top: 91.666667%;top-11/12
top: 100%;top-full
top: auto;top-auto

The spacing scale

top is written with top-*, which counts in steps of 0.25rem. The step number is the multiplier, so the class number is the value divided by that step rather than a pixel count.

Values that are not on the scale

Anything without a named class is written as an arbitrary value in square brackets. The converter falls back to this rather than rounding your CSS to the nearest class, because silently changing a value is worse than an ugly class name.

top-[your value]

Other layout properties

Converting a whole stylesheet?

Paste it into the converter and get every rule at once, shorthands expanded, media queries turned into breakpoint variants, and the parts that have no Tailwind equivalent flagged rather than dropped.

Open the converter