{"id":324740,"date":"2020-10-29T16:26:31","date_gmt":"2020-10-29T23:26:31","guid":{"rendered":"https:\/\/css-tricks.com\/?page_id=324740"},"modified":"2021-05-10T10:58:59","modified_gmt":"2021-05-10T17:58:59","slug":"mask-origin","status":"publish","type":"page","link":"https:\/\/css-tricks.com\/almanac\/properties\/m\/mask-origin\/","title":{"rendered":"mask-origin"},"content":{"rendered":"\n

The mask-origin<\/code> specifies the mask position area of a mask layer image<\/a>. In other words, it defines where the origin of the mask layer image is, whether it’s the edge of the border, padding or content box<\/a>.<\/p>\n\n\n\n

.element {\n\u00a0 mask-image: url(star.svg);\n\u00a0 mask-origin: content-box;\n}<\/code><\/pre>\n\n\n\n\n\n\n\n

For elements rendered as a single box, mask-origin<\/code> specifies the mask positioning area. For elements rendered as multiple boxes (e.g., inline boxes on several lines, boxes on several pages) the property specifies which boxes box-decoration-break<\/code> operates on to determine the mask positioning area.<\/p>\n\n\n\n

This property works like the background-origin<\/a><\/code> property, except it has different initial value and three additional values that apply to SVG elements.<\/p>\n\n\n\n

In the following demo you can change the origin of the mask layer image. There is the same image underneath to show the effect of masking better and marking the border and padding areas:<\/p>\n\n\n\n