{"id":323048,"date":"2020-10-12T12:19:22","date_gmt":"2020-10-12T19:19:22","guid":{"rendered":"https:\/\/css-tricks.com\/?page_id=323048"},"modified":"2021-05-10T10:59:42","modified_gmt":"2021-05-10T17:59:42","slug":"mask-position","status":"publish","type":"page","link":"https:\/\/css-tricks.com\/almanac\/properties\/m\/mask-position\/","title":{"rendered":"mask-position"},"content":{"rendered":"\n

In CSS, the mask-position<\/code> property specifies the initial position of a mask layer image<\/a> relative to the mask position area. It works like the background-position<\/a><\/code> property.<\/p>\n\n\n\n

.element {\n\u00a0 mask-image: url(\"star.svg\");\n\u00a0 mask-position: 20px center;\n}<\/code><\/pre>\n\n\n\n\n\n\n\n

Masking allows you to display selected parts of an element while hiding the rest. In the following demo, you can change the position of the mask layer image:<\/p>\n\n\n\n