Images

Image utilities control how images and background images fill their containers. The base layer already makes images responsive by default (max-width: 100%; height: auto;), so these utilities are for when you need more control.

Object Fit

Control how an <img> or <video> fills its container when you've set explicit dimensions:

Example
.object-cover

Fills container, crops if needed. Best for thumbnails and hero images.

Example
.object-contain

Fits entirely within container. Best for logos and product images.

Example
.object-fill

Stretches to fill. Distorts aspect ratio.

Also available: .object-none (natural size), .object-scale-down (like contain, but never scales up)

Object Position

When using .object-cover, control which part of the image remains visible:

Example
.object-top
Example
.object-center
Example
.object-bottom

Also available: .object-left, .object-right, and corner positions like .object-top-left

Background Images

For background images set via CSS or inline styles, use these utilities to control sizing, position, and repeat:

Size: .bg-cover, .bg-contain, .bg-auto
Position: .bg-center, .bg-top, .bg-bottom, .bg-left, .bg-right
Repeat: .bg-no-repeat, .bg-repeat
Attachment: .bg-fixed (parallax effect)

Common pattern for a hero background:

<div class="bg-cover bg-center bg-no-repeat" style="background-image: url('...')">
  ...
</div>