The background-clip
CSS property sets whether an element's background extends underneath its border box, padding box, or content box.
border-box
The background extends to the outside edge of the border (but underneath the border in z-ordering).
padding-box
The background extends to the outside edge of the padding. No background is drawn beneath the border
content-box
The background is painted within (clipped to) the content box.
If the length of background-clip
is less than background-image
, the first clip value will effect on all remained background-image
.
Initial value | border-box |
Applies to | all elements |
Inherited | no |
Animatable | no |
Only support border-box
、padding-box
、content-box
background-clip:text
is not support, and if want show text with gradient color, just set color: <gradient>
.