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";
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745574726a4633893.html
评论列表(0条)