property

mask-border — CSS reference

Nine-slice mask shorthand. Corners, edges and center supply coverage rather than a colored border. Omitted components reset. Tested Chromium 144 rejects this declaration. Check support before relying on it; the example preserves a conventional visible border.

Formal Syntax & Structure

css syntaxcss
<mask-border-source> || <mask-border-slice> [ / <mask-border-width>? [ / <mask-border-outset> ]? ]? || <mask-border-repeat> || <mask-border-mode> (representative)

Working Example

Example Snippetcss
<!doctype html><html lang="en"><meta charset="utf-8"><title>CSS masking and shapes lab</title><style>body {margin:0} .sample {background:#dcebe9;color:#182e32}body{background:white} #a{position:relative;margin:20px;width:80px;height:60px;background:red;box-sizing:content-box}#a{border:4px solid blue;mask-border:linear-gradient(black,black) 1}</style><body><div id="a" aria-hidden="true"></div><p>Decorative shape example.</p></body></html>
CSS Reference