CSS box-shadow Property
CSS box-shadow Property
CSS box-shadow
property attaches one or more shadows to an element.
Example
Syntax
Using CSS
Using Javascript
Animatable
Yes, box-shadow property is animatable. CSS Animatable Properties Reference.
Default Value
Default value for CSS box-shadow property is none.
Property Value
The following table provides a list of values for CSS box-shadow
property.
Value | Type | Explanation |
---|---|---|
none | - | No shadow is displayed. |
h-offset | Required | Specifies the horizontal offset of the shadow. A positive value puts the shadow on the right side of the box, a negative value puts the shadow on the left side of the box. |
v-offset | Required | Specifies the vertical offset of the shadow. A positive value puts the shadow below the box, a negative value puts the shadow above the box. |
blur-radius | Optional | Specifies the blur radius. The larger this value, the bigger the blur, so the shadow becomes bigger and lighter. Negative values are not allowed. |
spread-radius | Optional | Specifies the spread radius. Positive values will cause the shadow to expand and grow bigger, negative values will cause the shadow to shrink. |
color | Optional | Specifies the color of the shadow. |
inset | Optional | Changes the shadow from an outside the border (outset) to inside the border. |
Using JavaScript
In the following example, we will demonstrate how to set the CSS box-shadow
property of an element using JavaScript.
Example
Reminder
Hi Developers, we almost covered 98.7% of CSS Tutorials with examples for quick and easy learning.
We are working to cover every Single Concept in CSS.
Please do google search for:
Join Our Channel
Join our telegram channel to get an instant update on depreciation and new features on HTML, CSS, JavaScript, jQuery, Node.js, PHP and Python.
This channel is primarily useful for Full Stack Web Developer.