Skip to main content

Background Size

Utilities for controlling the background size of an element's background image.

CSS Property:background-size
Classes:3

Background Size Classes

ClassCSS
bg-autobackground-size: auto;
bg-coverbackground-size: cover;
bg-containbackground-size: contain;

Arbitrary Values

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

[background-size:value]

Responsive Variants

Apply background size utilities at specific breakpoints using responsive prefixes.

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