text-shadow

Description

The text-shadow property adds shadow to text.

ItemValue
Initial value none
Inherited Yes
Version CSS3
JavaScript syntax object.style.textShadow="2px 2px #ff0000"

Syntax and Property Values


text-shadow: h-shadow v-shadow blur color;

The property values are listed in the following table.

ValueRequired Description
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.

Example


<!DOCTYPE html>
<html>
<head>
<style>
    h1 {text-shadow:2px 2px #FF0000;}<!--   ww w  . j  a  v a  2s .c  o  m-->
</style>
</head>
<body>

    <h1>Text-shadow effect</h1>

</body>
</html>

Click to view the demo

The code above generates the following result.

text-shadow




















Home »
  HTML CSS »
    HTML CSS Reference »




HTML Tag Reference
CSS Reference
CSS Selector Reference
Encoding Reference