如何测试浏览器对Background-clip:text的支持?

Law*_*nce 5 javascript css css3

你如何测试background-clip的值:text,webkit支持文本,但是mozilla和其他浏览器我没有尝试过modernizr teststyles但没有运气

Ink*_*bug 6

var testEl = document.createElement( "x-test" );
var supportsWebkitBackgroundClipText = typeof testEl.style.webkitBackgroundClip !== "undefined" && ( testEl.style.webkitBackgroundClip = "text", testEl.style.webkitBackgroundClip === "text" );
Run Code Online (Sandbox Code Playgroud)