bg-cover

The bg-cover class belongs to the background size group within the backgrounds category.

Example Usage

Here is an example of how to use bg-cover:

<div class="bg-cover p-8 w-96 h-96 rounded-xl bg-no-repeat bg-center bg-[url('/placeholders/mountain.jpg')]"></div>

Resulting CSS

background-size: cover;

Other Background size Classes

Get Tailwind Scanner!

The absolute must-have tool for anyone using Tailwind CSS.

Scan, Edit, Export any tailwind site in browser to create the perfect UI - download the chrome extension!