property

Border clip — CSS reference

Experimental draft: Sets the same clipping sequence on all four border edges. The proposed list alternates visible and invisible segments; the flexible middle receives remaining edge length after the fixed ends. Horizontal lists run left to right and vertical lists top to bottom. The gradient alternative paints two 10px end segments on the explicitly selected physical edge(s); it does not create actual border geometry or automatically map logical sides.

Formal Syntax & Structure

css syntaxcss
border-clip: 10px 1fr 10px;

Working Example

Example Snippetcss
<!doctype html><html lang="en"><meta charset="utf-8"><title>border-clip</title><style>body{margin:0;background:white}#a{box-sizing:border-box;width:120px;height:80px}#a{writing-mode:horizontal-tb;direction:ltr;background-image:linear-gradient(to right,rgb(220,38,38) 0 10px,transparent 10px calc(100% - 10px),rgb(220,38,38) calc(100% - 10px)),linear-gradient(to right,rgb(220,38,38) 0 10px,transparent 10px calc(100% - 10px),rgb(220,38,38) calc(100% - 10px)),linear-gradient(to bottom,rgb(220,38,38) 0 10px,transparent 10px calc(100% - 10px),rgb(220,38,38) calc(100% - 10px)),linear-gradient(to bottom,rgb(220,38,38) 0 10px,transparent 10px calc(100% - 10px),rgb(220,38,38) calc(100% - 10px));background-size:100% 4px,100% 4px,4px 100%,4px 100%;background-position:top,bottom,left,right;background-repeat:no-repeat;border-clip:10px 1fr 10px}</style><body><div id="a" aria-label="Decorative example"></div></body></html>
CSS Reference