是否有-moz-mask CSS属性,如-webkit-mask-image? [英] Is there a -moz-mask CSS property, like -webkit-mask-image?
问题描述
Firefox不支持 -moz-mask-image
It seems -moz-mask-image
is not supported in Firefox.
我正在尝试一个前景梯度。我不能使用图像,因为我需要文本是可选择的。有谁对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?
此版本适用于Chrome和Safari Safari。
This version works in chrome and safari
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)));
推荐答案
根据MDN,你可以使用 mask
for Firefox,为Firefox 3.5:
According to MDN, you can just use mask
for Firefox, as of Firefox 3.5:
- https://developer.mozilla.org/en/CSS/mask
但是, mask
需要SVG图像作为掩码。您可以 base-64将SVG图片编码到样式表,或者您可以使用SVG图片文件。
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.
这篇关于是否有-moz-mask CSS属性,如-webkit-mask-image?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!