admin管理员组文章数量:1431391
I use JavaScript to set the CSS text-shadow
property. Here is my code to set the text-shadow
property:
var text = document.getElementById("text");
text.style.textShadow = "1px 1px 0 red";
Once I set it, how do I unset the CSS text-shadow
property using JavaScript? I tried
text.style.textShadow = "0 0 0 0";
but it does not work.
I use JavaScript to set the CSS text-shadow
property. Here is my code to set the text-shadow
property:
var text = document.getElementById("text");
text.style.textShadow = "1px 1px 0 red";
Once I set it, how do I unset the CSS text-shadow
property using JavaScript? I tried
text.style.textShadow = "0 0 0 0";
but it does not work.
Share Improve this question edited Feb 26, 2016 at 22:22 gariepy 3,6846 gold badges23 silver badges34 bronze badges asked Dec 7, 2011 at 5:56 user774411user774411 1,8156 gold badges29 silver badges47 bronze badges3 Answers
Reset to default 4text.style.textShadow = "none";
Or, depending on your needs:
text.style.textShadow = "inherit";
Try:
text.style.textShadow = "none";
In fact, playing around with this, setting it to "0 0"
, null
, and ""
all seem to work as well.
See working test: http://jsfiddle/YwPF9/
I think
text.style.textShadow = "0 0";
本文标签: How to unset CSS textshadow using JavaScriptStack Overflow
版权声明:本文标题:How to unset CSS text-shadow using JavaScript? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745574725a2664259.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论