Skip to main content

Object Fit

Utilities for controlling how a replaced element's content should be resized.

CSS Property:object-fit
Classes:5

Object Fit Classes

ClassCSS
object-containobject-fit: contain;
object-coverobject-fit: cover;
object-fillobject-fit: fill;
object-noneobject-fit: none;
object-scale-downobject-fit: scale-down;

Arbitrary Values

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

object-[cover]

Responsive Variants

Apply object fit utilities at specific breakpoints using responsive prefixes.

BreakpointPrefixExample
640px+sm:sm:object-contain
768px+md:md:object-contain
1024px+lg:lg:object-contain
1280px+xl:xl:object-contain
1536px+2xl:2xl:object-contain