Javascript examples for CSS Style Property:textShadow
The textShadow property sets or gets one ore more shadow effects for a text.
Value | Description |
---|---|
none | No shadow is drawn. Default |
h-shadow | Required. The position of the horizontal shadow. Negative values are allowed |
v-shadow | Required. The position of the vertical shadow. Negative values are allowed |
blur | Optional. The blur distance |
color | Optional. The color of the shadow. |
initial | Sets this property to its default value. |
inherit | Inherits this property from its parent element. |
Item | Value |
---|---|
Default Value: | none? |
Return Value: | A String, representing a comma-separated list of shadow effects applied to the text of the element |
CSS Version | CSS3 |
Add shadow to a text:
<!DOCTYPE html> <html> <body> <p id="myP" style="text-shadow:2px 2px green;">This is an example paragraph.</p> <button type="button" onclick="myFunction()">Test</button> <script> function myFunction() {//from www. j av a 2 s.com document.getElementById("myP").style.textShadow = '2px 2px red'; } </script> </body> </html>