SVG参考手册
分类 | Elements
fedropshadow
<feDropShadow>
滤波器产生原始输入图像的阴影。它是一个简写过滤器,并且由其他过滤器基元的组合来定义。
<feDropShadow>
过滤器的结果等同于以下内容:
<feGaussianBlur in="alpha-channel-of-feDropShadow-in"
stdDeviation="stdDeviation-of-feDropShadow"/>
<feOffset dx="dx-of-feDropShadow" dy="dy-of-feDropShadow"
result="offsetblur"/>
<feFlood flood-color="flood-color-of-feDropShadow"
flood-opacity="flood-opacity-of-feDropShadow"/>
<feComposite in2="offsetblur" operator="in"/>
<feMerge>
<feMergeNode/>
<feMergeNode in="in-of-feDropShadow"/>
</feMerge>
用法上下文
分类 |
过滤基元 |
---|---|
允许的内容 |
以任何顺序包含任意数量的以下元素:<animate>,<script>,<set> |
属性
全局属性
- Core attributes
- Presentation attributes
- Filter primitive attributes
Specific attributes
class
style
in
stdDeviation
dx
dy
DOM接口
这个元素实现了SVGFEDropShadowElement
接口。
例
SVG
<svg width="200" height="200" xmlns="http://www.w3.org/2000/svg">
<defs>
<filter id="shadow">
<feDropShadow dx="4" dy="8" stdDeviation="4"/>
</filter>
</defs>
<circle cx="50%" cy="50%" r="80"
style="fill:blue; filter:url(#shadow);"/>
</svg>
结果
产品规格
Specification |
Status |
Comment |
---|---|---|
Filter Effects Module Level 1The definition of '<feDistantLight>' in that specification. |
Working Draft |
Initial definition |
浏览器兼容性
Feature |
Chrome |
Edge |
Firefox (Gecko) |
Internet Explorer |
Opera |
Safari |
---|---|---|---|---|---|---|
Basic support |
(Yes) |
No support |
(Yes) |
No support |
(Yes) |
? |
Feature |
Android |
Firefox Mobile (Gecko) |
IE Phone |
Opera Mobile |
Safari Mobile |
---|---|---|---|---|---|
Basic support |
? |
? |
? |
? |
? |