Background Clip Property

Last updated: 2026-09-13

background-clip Background Clip Property

background-clip controls the painting area of a background, deciding within which box-model region the background (color or image) is shown. The default border-box extends the background under the border, padding-box clips it to the padding area, and content-box shows it only in the content area. CSS3 also added the text value for text clipping effects.

Category
Initial Valueborder-box
InheritedNo
Applies To
Animation Type
CSS VersionCSS3
StatusStandard

📝 Syntax

background-clip: border-box | padding-box | content-box | text;

⚙️ Values

ValueTypeDescription
border-box | padding-box | content-box | textKeywordBackground painting area

▶ Example

Edit the code below and see the live result in the playground:

🌐 Browser Support

Browser ChromeChrome EdgeEdge FirefoxFirefox SafariSafari OperaOpera
background-clip v4 v12 v4 v3.1 v10
Supported in all major browsers
Tip: The difference between border-box and padding-box is easier to see with a transparent or dashed border.
Important: background-clip: text requires -webkit-text-fill-color: transparent to reveal the text-clipped effect.

❓ FAQ

QWhat is the difference between background-clip and background-origin?
Aclip controls where the background stops being painted (the clipping boundary), while origin controls the reference point for background-image positioning. For example, clip: border-box lets the background extend under the border, while origin: border-box positions the image from the border's top-left corner. background-color is only affected by clip; origin applies only to background images.
QHow do I create a gradient text effect?
AThree steps: set the gradient with background-image; clip the background to the text outline with background-clip: text; and make the text fill transparent with -webkit-text-fill-color: transparent. Also add background-repeat: no-repeat so the gradient does not tile.
QWhat does each of the three background-clip values do?
Aborder-box (default): the background extends into the border area, and the border is painted above it. padding-box: the background only shows inside the padding area, with no background under the border. content-box: the background shows only in the content area, so even the padding region has no background. Add a border to an element and compare — a transparent or dashed border makes the difference obvious.
QWhat is the browser support for background-clip: text?
AModern browsers all support background-clip: text, but older Safari/Chrome need the -webkit-background-clip: text prefix plus -webkit-text-fill-color: transparent. Where unsupported, the text falls back to a normal fill color, so it is a good idea to provide a fallback via @supports.

📚 Related Tutorials

Web-Tutorial.com

Web-Tutorial Tech Team

A team of developers maintaining programming tutorials. Each tutorial is written and reviewed by developers with expertise in that field. We work to keep our content accurate and reliable — if you spot an issue, please let us know.

100%

🙏 帮我们做得更好

我们是刚上线的编程教程站,几个人的小团队,精力有限。页面虽经检查,难免还有疏漏——链接失效、排版错乱、内容有误、语言生硬……

如果您发现了,麻烦告诉我们,我们会在收到反馈后第一时间进行修复,再次感谢您的光临 🙏