Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
mohamedkhallouq
GitHub Repository: mohamedkhallouq/content
Path: blob/main/files/en-us/web/svg/element/feoffset/index.md
6546 views
---
title: <feOffset> slug: Web/SVG/Element/feOffset page-type: svg-element tags: - Element - SVG - SVG Filter browser-compat: svg.elements.feOffset
---

{{SVGRef}}

The <feOffset> SVG filter primitive allows to offset the input image. The input image as a whole is offset by the values specified in the {{SVGAttr("dx")}} and {{SVGAttr("dy")}} attributes.

Usage context

{{svginfo}}

Attributes

Global attributes

Specific attributes

  • {{SVGAttr("in")}}

  • {{SVGAttr("dx")}}

  • {{SVGAttr("dy")}}

DOM Interface

This element implements the {{domxref("SVGFEOffsetElement")}} interface.

Example

SVG

<svg width="200" height="200" xmlns="http://www.w3.org/2000/svg"> <defs> <filter id="offset" width="180" height="180"> <feOffset in="SourceGraphic" dx="60" dy="60" /> </filter> </defs> <rect x="0" y="0" width="100" height="100" stroke="black" fill="green" /> <rect x="0" y="0" width="100" height="100" stroke="black" fill="green" filter="url(#offset)" /> </svg>

Result

{{EmbedLiveSample("Example", 200, 200)}}

Specifications

{{Specifications}}

Browser compatibility

{{Compat}}

See also

  • {{SVGElement("filter")}}

  • {{SVGElement("animate")}}

  • {{SVGElement("set")}}

  • {{SVGElement("feBlend")}}

  • {{SVGElement("feColorMatrix")}}

  • {{SVGElement("feComponentTransfer")}}

  • {{SVGElement("feComposite")}}

  • {{SVGElement("feConvolveMatrix")}}

  • {{SVGElement("feDiffuseLighting")}}

  • {{SVGElement("feDisplacementMap")}}

  • {{SVGElement("feFlood")}}

  • {{SVGElement("feGaussianBlur")}}

  • {{SVGElement("feImage")}}

  • {{SVGElement("feMerge")}}

  • {{SVGElement("feMorphology")}}

  • {{SVGElement("feSpecularLighting")}}

  • {{SVGElement("feTile")}}

  • {{SVGElement("feTurbulence")}}

  • SVG tutorial: Filter effects