SVG参考手册
分类 | Elements
feoffset
<feOffset>
SVG过滤器原语允许以抵消对输入图像。输入图像作为一个整体被dx
和dy
属性中指定的值所偏移。
用法上下文
分类 |
过滤基元 |
---|---|
允许的内容 |
以任意顺序包含以下任意数量的元素:<animate>,<set> |
属性
全局属性
- Core attributes
- Presentation attributes
- Filter primitive attributes
class
style
具体属性
in
dx
dy
DOM接口
这个元素实现了SVGFEOffsetElement
接口。
例
SVG
<svg width="200" height="200" xmlns="http://www.w3.org/2000/svg">
<defs>
<filter id="feOffset" x="-40" y="-20" width="100" height="200">
<feOffset in="SourceGraphic" dx="60" dy="60" />
</filter>
</defs>
<rect x="40" y="40" width="100" height="100"
style= "stroke : #000000; fill: green; filter: url(#feOffset);" />
<rect x="40" y="40" width="100" height="100"
style= "stroke : #000000; fill: green; " />
</svg>
Result
产品规格
Specification |
Status |
Comment |
---|---|---|
Filter Effects Module Level 1The definition of '<feOffset>' in that specification. |
Working Draft |
No change |
Scalable Vector Graphics (SVG) 1.1 (Second Edition)The definition of '<feOffset>' in that specification. |
Recommendation |
Initial definition |
浏览器兼容性
Feature |
Chrome |
Edge |
Firefox (Gecko) |
Internet Explorer |
Opera |
Safari |
---|---|---|---|---|---|---|
Basic support |
(Yes) |
(Yes) |
4.0 (2.0) |
(Yes) |
9.0 |
? |
Feature |
Android |
Edge |
Firefox Mobile (Gecko) |
IE Phone |
Opera Mobile |
Safari Mobile |
---|---|---|---|---|---|---|
Basic support |
? |
(Yes) |
? |
? |
? |
? |