property

webkit mask box image — CSS reference

Nonstandard border-image-like masking shorthand for slicing a source into corner, edge and center regions. The fill keyword in the tested implementation retains the center region. Standard mask-border is the related feature, not a guaranteed interchangeable alias; feature-detect separately. Use ordinary mask-image when a simple whole-element mask is sufficient.

Formal Syntax & Structure

css syntaxcss
-webkit-mask-box-image: linear-gradient(black,black) 10 fill / 10px;

Working Example

Example Snippetcss
<!doctype html><html lang="en"><meta charset="utf-8"><title>-webkit-mask-box-image</title><style>body{margin:0;background:white}#a{box-sizing:border-box}#a{width:60px;height:60px;background:red;-webkit-mask-box-image:linear-gradient(black,black) 10 fill / 10px}</style><body><div id="a" role="img" aria-label="Red masked sample"></div></body></html>
CSS Reference