I've been trying to get CSS-Mask to work. I've tried PNG(24/32),SVG & GIF with no results ?
background-image:url("/wdp/images/grid.png");
-webkit-mask:url("/wdp/images/x320svg-mask.svg") top alpha;
I've been trying to get CSS-Mask to work. I've tried PNG(24/32),SVG & GIF with no results ?
background-image:url("/wdp/images/grid.png");
-webkit-mask:url("/wdp/images/x320svg-mask.svg") top alpha;
— pointed to the right place, but the Chrome error you saw usually means the value you gave the image property included tokens it does not accept. In Blink/WebKit the image property expects just an image reference. Position, repeat, size and the mask "mode" must be set with the matching longhand properties or with the proper shorthand. Also confirm the mask image actually contains transparency (alpha) and that it loads without cross‑origin blocking.
Example (use different file names than your test files):
.box {
-webkit-mask-image: url('mask-sample.png');
-webkit-mask-position: top center;
-webkit-mask-repeat: no-repeat;
-webkit-mask-size: contain;
mask-image: url('mask-sample.png');
mask-mode: alpha;
}
.box.alt {
-webkit-mask: url('mask-sample.png') top center / contain no-repeat;
mask: url('mask-sample.png') top center / contain no-repeat;
} Troubleshooting checklist:
References: MDN mask overview (mask) and cross‑browser notes (Can I use: CSS masks). For historical WebKit behavior see the WebKit blog on masks ().
Jump to Post— gentlemedia 803It should be
-webkit-mask-image.
It should be -webkit-mask-image.
I've tried mask-image, doesn't work, the latest version of Chrome give me a invalid property value;
-webkit-mask-image: url("/wdp/wip/x32024.png") top alpha;
Can you post your page online somewhere?
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.