background-clip: border-area
The background-clip: border-area CSS declaration draws the background underneath only the border of an element.
Browser support
| Feature | Desktop | Mobile | ||||
|---|---|---|---|---|---|---|
| Chrome | Edge | Firefox | Safari | Chrome Android | Safari iOS | |
css.properties.background-clip.border-area | | | | 18.2 | | 18.2 |
1+Supported (version) Not supported ※Has note Sub-feature descriptions sourced from MDN Web Docs (CC BY-SA 2.5)
Syntax
CSS
.gradient-border {
border: 4px solid transparent;
background: linear-gradient(45deg, red, blue);
background-clip: border-area;
} Live demo
Use cases
-
Decorative enhancement
Use background-clip: border-area to add depth, masking, blending, or special treatment to supporting visuals.
-
Brand expression
Apply effects where the interface benefits from stronger visual identity but still works in simpler environments.
Cautions
- Heavy effects can hurt performance or readability on lower-end devices.
- Do not use visual effects as the only way to communicate meaning or state.
Accessibility
- Maintain text contrast and focus visibility when applying overlays, filters, or blend effects.
- Visual polish should never reduce content legibility.