W3cubDocs

/SVG

SVG attribute: crossorigin

The crossorigin attribute, valid on the <image> and <feImage> elements, provides support for configuration of the Cross-Origin Resource Sharing (CORS) requests for the element's fetched data.

This table shows possible keywords and their meaning:

Keyword Description
anonymous Client CORS requests for this element will have the credentials flag set to 'same-origin'.
use-credentials Client CORS requests for this element will have the credentials flag set to 'include'.
"" Setting the attribute name to an empty value, like crossorigin or crossorigin="", is the same as anonymous.

It follows the same processing rules as the HTML attribute crossorigin.

Example

<svg width="200" height="200" xmlns="http://www.w3.org/2000/svg">
  <image
    href="https://example.com/mdn_logo_dark.png"
    height="200"
    width="200"
    crossorigin="use-credentials" />
</svg>

Specifications

Browser compatibility

>

svg.elements.feImage.crossorigin

Desktop Mobile
Chrome Edge Firefox Opera Safari Chrome Android Firefox for Android Opera Android Safari on IOS Samsung Internet WebView Android WebView on iOS
crossorigin No No 114 No No No 114 No No No No No

svg.elements.image.crossorigin

Desktop Mobile
Chrome Edge Firefox Opera Safari Chrome Android Firefox for Android Opera Android Safari on IOS Samsung Internet WebView Android WebView on iOS
crossorigin 118 118 114 104 17.2 118 114 79 17.2 25.0 118 17.2

See also

© 2005–2025 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/SVG/Reference/Attribute/crossorigin