{"id":321696,"date":"2020-09-23T15:34:21","date_gmt":"2020-09-23T22:34:21","guid":{"rendered":"https:\/\/css-tricks.com\/?page_id=321696"},"modified":"2022-06-14T10:47:01","modified_gmt":"2022-06-14T17:47:01","slug":"mask-size","status":"publish","type":"page","link":"https:\/\/css-tricks.com\/almanac\/properties\/m\/mask-size\/","title":{"rendered":"mask-size"},"content":{"rendered":"\n

In CSS, the mask-size<\/code> property specifies the size of a mask layer image. In many ways, it works very much like the background-size<\/a><\/code> property.<\/p>\n\n\n\n

.element {\n\u00a0 mask-image: url(star.svg);\n\u00a0 mask-size: 200px 100px;\n}<\/code><\/pre>\n\n\n\n

Masking allows you to display selected parts of an element while hiding the rest. The size of the mask is defined by the mask-size<\/code> property.<\/p>\n\n\n\n\n\n\n\n

In the following demo you can play around with the size of the mask layer image:<\/p>\n\n\n\n