feoffset

<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

产品规格

SpecificationStatusComment
Filter Effects Module Level 1The definition of '<feOffset>' in that specification.Working DraftNo change
Scalable Vector Graphics (SVG) 1.1 (Second Edition)The definition of '<feOffset>' in that specification.RecommendationInitial definition

浏览器兼容性

FeatureChromeEdgeFirefox (Gecko)Internet ExplorerOperaSafari
Basic support(Yes)(Yes)4.0 (2.0)(Yes)9.0?

FeatureAndroidEdgeFirefox Mobile (Gecko)IE PhoneOpera MobileSafari Mobile
Basic support?(Yes)????