Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

HTML DOM Style textShadow property

Style textShadow property

Style Object Reference The Style object


Definition and Usage

The textShadow property sets or returns one or more shadow effects for text.

Syntax

Set the textShadow property:

Object.style.textShadow="none|

h-shadow v-shadow blur color

|inherit"

**Note:** The textShadow property adds one or more shadows to text. This property is a comma-separated list of shadows, where each value is specified by 2 or 3 length values and an optional color. Omitted lengths are set to 0.

Return the textShadow property:

Object.style.textShadow

Value Description
none Default. No shadow is drawn.
h-shadow Required. The horizontal position of the shadow. Negative values are allowed.
v-shadow Required. The vertical position of the shadow. Negative values are allowed.
blur Optional. The blur distance.
color Optional. The color of the shadow. In A CSS color value the CSS color reference you can find a complete list of possible color values.
inherit The value of the textShadow property is inherited from the parent element.

Browser support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the textShadow property, except Internet Explorer.


Example

Example

Add a shadow to text:

Runoob Tutorial(runoob.com)

This is some text.


Try it »


Style Object Reference The Style object