Browse documentation

Reference / Backgrounds

Background clipping

Limit the painted background to the border, padding, content, or letter shapes.

Working example

When clipping to text, a transparent foreground exposes the image through the glyphs. Keep all parts of the gradient readable.

HTML
<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

ClassCSS declarations
bg-clip-borderbackground-clip: border-box;
bg-clip-paddingbackground-clip: padding-box;
bg-clip-contentbackground-clip: content-box;
bg-clip-textbackground-clip: text;
View full generated CSS
Compiled 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;
}