Is there a -moz-mask CSS property, like -webkit-mask-image?

牧云@^-^@ 提交于 2019-11-27 03:16:19

问题


It seems -moz-mask-image is not supported in 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?

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)));

回答1:


According to MDN, you can just use mask for Firefox, as of Firefox 3.5:

  • https://developer.mozilla.org/en/CSS/mask

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.



来源:https://stackoverflow.com/questions/8414348/is-there-a-moz-mask-css-property-like-webkit-mask-image

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!