/* Keyword values */
mask-origin: content-box;
mask-origin: padding-box;
mask-origin: border-box;
mask-origin: fill-box;
mask-origin: stroke-box;
mask-origin: view-box;
/* Multiple values */
mask-origin: padding-box, content-box;
mask-origin: view-box, fill-box, border-box;
/* Global values */
mask-origin: inherit;
mask-origin: initial;
mask-origin: revert;
mask-origin: revert-layer;
mask-origin: unset;`mask-origin` CSS property / notebook
`mask-origin` CSS property
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.
<section class="content">
<div></div>
</section>
<section class="padding">
<div></div>
</section>
<section class="border">
<div></div>
</section>
<section class="comparison">
<div></div>
</section>div {
width: 100px;
height: 100px;
margin: 10px;
border: 10px solid blue;
background-color: #8cffa0;
padding: 10px;
mask-image: url("https://mdn.github.io/shared-assets/images/examples/mask-star.svg");
}
section {
border: 1px solid black;
}.content div {
mask-origin: content-box;
}
.padding div {
mask-origin: padding-box;
}
.border div {
mask-origin: border-box;
}
.comparison div {
mask-image: none;
}section::before {
content: attr(class);
display: block;
text-align: center;
}