<box-shadow>
Cast an independent shadow from sampled rectangle geometry.
A box shadow uses the shape's rounded rectangle as its caster. A shape may have multiple box shadows, including on a rectangle with no fill.
Syntax
Put an inset shadow on an unfilled panel
The purple band paints at (21, 35) while (35, 35) stays transparent. At (16, 35) the mint stroke paints over the shadow.
<box-shadow inset="true" dx="8" dy="0" sigma="0" spread="2" color="#B34FE9FF"/>Complete .nothing source · Sample checks
Usage context
Allowed parents are <shape>.
Includes Gaussian blur, Shadow style.
Requires rectangle geometry. Outer shadows paint behind the fill. Inset shadows paint after the fill and before every stroke. Paint in document order within each kind.
Attributes
inset
Value false, true · If omitted false · Keys Held
True shades inside the rectangle. False casts outside the rectangle. Inset box shadows
spread
Value local units · If omitted 0 · Keys Scalar
Positive spread grows an outer caster or shrinks an inset opening. Negative spread reverses the adjustment.
sigma
Value local units · If omitted 0 · Keys Scalar · Declared by Gaussian blur
Nonnegative Gaussian standard deviation. Zero copies the input to the blur stage.
dx
Value local units · If omitted 0 · Keys Scalar · Declared by Shadow style
Horizontal displacement, positive to the right.
dy
Value local units · If omitted 0 · Keys Scalar · Declared by Shadow style
Vertical displacement, positive down.
color
Value #RRGGBBAA · Required · Keys Color channels · Declared by Shadow style
Required shadow tint in encoded sRGB with linear alpha. The filter converts the sampled color to its working space.
Children
| Elements | Cardinality | Declared by | Role and source order |
|---|---|---|---|
<animate> | Zero or more | Animation | A track targets one keyable property on this owner. For equal first-key times, the later track in document order wins. Evaluating animation tracks |