← Tailwind CSS classes list

Tailwind CSS class: .bg-contain

<div class="bg-contain h-48 w-64" style="background-image: url('https://tailwind.build/placeholders/pictures/office.jpg')"></div>

Preview

CSS source

.bg-contain {
  background-size: contain;
}

More in Tailwind CSS Background