Skip to main content

Aspect Ratio

Utilities for controlling the aspect ratio of an element.

CSS Property:aspect-ratio
Classes:8

Aspect Ratio Classes

ClassCSS
aspect-autoaspect-ratio: auto;
aspect-squareaspect-ratio: 1 / 1;
aspect-videoaspect-ratio: 16 / 9;
aspect-4/3aspect-ratio: 4 / 3;
aspect-3/2aspect-ratio: 3 / 2;
aspect-2/3aspect-ratio: 2 / 3;
aspect-9/16aspect-ratio: 9 / 16;
aspect-3/4aspect-ratio: 3 / 4;

Arbitrary Values

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

aspect-[4/3]aspect-[16/10]

Responsive Variants

Apply aspect ratio utilities at specific breakpoints using responsive prefixes.

BreakpointPrefixExample
640px+sm:sm:aspect-auto
768px+md:md:aspect-auto
1024px+lg:lg:aspect-auto
1280px+xl:xl:aspect-auto
1536px+2xl:2xl:aspect-auto