Backgrounds
Utilities for controlling the bounding box of an element's background.
Class | Styles |
---|---|
bg-clip-border | background-clip: border-box; |
bg-clip-padding | background-clip: padding-box; |
bg-clip-content | background-clip: content-box; |
bg-clip-text | background-clip: text; |
Use the bg-clip-border
, bg-clip-padding
, and bg-clip-content
utilities to control the bounding box of an element's background:
Use the bg-clip-text
utility to crop an element's background to match the shape of the text:
Prefix a background-clip
utility with a breakpoint variant like md:
to only apply the utility at medium screen sizes and above:
<div class="bg-clip-border md:bg-clip-padding ..."> <!-- ... --></div>
Learn more about using variants in the variants documentation.