Browse documentation
Reference / Backgrounds
Background clipping
Limit the painted background to the border, padding, content, or letter shapes.
Working example
Editions
When clipping to text, a transparent foreground exposes the image through the glyphs. Keep all parts of the gradient readable.
<h3 class="inline-block bg-gradient-to-r from-black to-neutral-500 bg-clip-text text-transparent font-serif text-4xl">
Editions
</h3>Class reference
| Class | CSS declarations |
|---|---|
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; |
View full generated CSS
.bg-clip-border {
background-clip: border-box;
}
.bg-clip-content {
background-clip: content-box;
}
.bg-clip-padding {
background-clip: padding-box;
}
.bg-clip-text {
background-clip: text;
}