mask-border-width: value; object.style.maskBorderWidth = "value"; <'mask-border-width'> = [ <length-percentage> | <number> | auto ]{1,4} <length-percentage> =
<length> |
<percentage> <length> Specifies the length using a number followed by a unit of measurement.
<percentage> Specifies the percentage using a number followed by a percent sign (%).
<number> An integer or zero or more decimal digits followed by a dot (.) followed by one or more decimal digits. The first character may be preceded by a sign (- or +). The last character may be succeeded by an exponent (e or E) and an integer.
auto Automatically specified by the user agent.
<!doctype html>
<html>
<head>
<style>
div
{
border-color: yellow;
border-style: solid;
border-width: 20px;
mask-border-slice: 33.33%;
mask-border-source: url(/assets/svg/9Slice.svg);
mask-border-width: 10px 20px 30px 40px;
}
</style>
</head>
<body>
<div>length</div>
</body>
</html>
<!doctype html>
<html>
<head>
<style>
div
{
border-color: yellow;
border-style: solid;
border-width: 20px;
mask-border-slice: 33.33%;
mask-border-source: url(/assets/svg/9Slice.svg);
mask-border-width: 10 20 30 40;
}
</style>
</head>
<body>
<div>number</div>
</body>
</html>
<!doctype html>
<html>
<head>
<style>
div
{
border-color: yellow;
border-style: solid;
border-width: 20px;
mask-border-slice: 33.33%;
mask-border-source: url(/assets/svg/9Slice.svg);
mask-border-width: 10% 20% 30% 40%;
}
</style>
</head>
<body>
<div>percentage</div>
</body>
</html>
<!doctype html>
<html>
<head>
<style>
div
{
border-color: yellow;
border-style: solid;
border-width: 20px;
mask-border-slice: 33.33%;
mask-border-source: url(/assets/svg/9Slice.svg);
}
</style>
</head>
<body>
<button>initial</button>
<button>auto</button>
<button value="10px 20px 30px 40px">length</button>
<button value="10 20 30 40">number</button>
<button value="10% 20% 30% 40%">percentage</button>
<div>mask-border-width</div>
<script>
function myfunction(myparameter)
{
const mytarget = myparameter.target;
const myproperty = mytarget.value || mytarget.innerHTML;
document.querySelector("div").style.maskBorderWidth = myproperty;
}
for(const mybutton of document.querySelectorAll("button"))
{
mybutton.addEventListener("mouseover", myfunction);
}
</script>
</body>
</html>