Background image
Tailwind CSS Background image
Use responsive background image component with TW elements. With this tutorial, you'll learn how to seamlessly set an image as the background of an item.
Basic example
Use an image as a background in 3 steps:
- Add
background-image
via inline CSS. - Define the background
height
. -
Add
.bg-cover
class to scale the image properly and enable responsiveness.
Jumbotron
Outstand your call to action elements by catching the eyes to some beautiful image in the background. To provide a proper contrast it's highly recommended to use a mask.
Heading
Subheading
Cards with background image
To get a card with a background image, use the card component and add a background image to it as in the basic example, skipping the second step (setting the image height).
Card title
Some quick example text to build on the card title and make up the bulk of the card's content.
Card title
Some quick example text to build on the card title and make up the bulk of the card's content.