是否有 -moz-mask CSS 属性,例如 -webkit-mask-image?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/8414348/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Is there a -moz-mask CSS property, like -webkit-mask-image?
提问by MALK
It seems -moz-mask-image
is not supported in Firefox.
-moz-mask-image
Firefox似乎不支持。
I am attempting a foreground gradient. I can't use an image as i need the text to be selectable. Does anyone have any ideas for Firefox?
我正在尝试前景渐变。我不能使用图像,因为我需要可以选择文本。有没有人对 Firefox 有任何想法?
This versionworks in chrome and safari
此版本适用于 chrome 和 safari
css:
css:
-webkit-mask-image: -webkit-gradient(linear, left bottom, left top, color-stop(0.16, rgba(0,0,0,0)), color-stop(0.52, rgba(0,0,0,.5)), color-stop(0.77, rgba(0,0,0,1)));
-moz-mask: -moz-gradient(linear, left bottom, left top, color-stop(0.16, rgba(0,0,0,0)), color-stop(0.52, rgba(0,0,0,.5)), color-stop(0.77, rgba(0,0,0,1)));
回答by Paul D. Waite
According to MDN, you can just use mask
for Firefox, as of Firefox 3.5:
根据 MDN,mask
从 Firefox 3.5 开始,您可以只用于 Firefox:
However, mask
requires an SVG image to act as the mask. You might be able to base-64 encode your SVG image into your stylesheet, or you can use an SVG image file.
但是,mask
需要一个 SVG 图像作为掩码。您可以将SVG 图像进行base-64 编码到样式表中,或者您可以使用 SVG 图像文件。