Easy Tutorial
❮ Prop Style Textoverflow Jsref Charat ❯

boxShadow Property

Style Object

Example

Add a shadow to a div element:


Definition and Usage

The boxShadow property sets or returns the drop shadow of an element.


Browser Support

IE9+, Firefox, Chrome, Opera, and Safari 5.1.1 support the boxShadow property.


Syntax

Return the boxShadow property:

Set the boxShadow property:

Note: The boxShadow property adds one or more drop shadows to the box. It is a comma-separated list of shadows, each specified by 2-4 length values, an optional color value, and an optional inset keyword. Omitted lengths are 0.

Property Values

Value Description
none Default value. No shadow is shown.
h-shadow Required. The position of the horizontal shadow. Allows negative values.
v-shadow Required. The position of the vertical shadow. Allows negative values.
blur Optional. The blur distance.
spread Optional. The size of the shadow.
color Optional. The color of the shadow. The default value is black. For a complete list of possible color values, see CSS Color Values <br> <br> Note: In Safari (on PC), the color parameter is required. If you do not specify a color, the shadow will not be displayed.
inset Optional. Changes the outer shadow (outset) to an inner shadow.
initial Sets this property to its default value. See initial
inherit Inherits this property from its parent element. See inherit

Technical Details

Default value: none
Return value: String, representing the box-shadow property of the element.
--- ---
CSS version CSS3
--- ---

Related Articles

CSS Reference: box-shadow Property


Style Object

❮ Prop Style Textoverflow Jsref Charat ❯