Deprecated since SVG 2
This feature has been removed from the Web standards. Though some browsers may still support it, it is in the process of being dropped. Avoid using it and update existing code if possible; see the compatibility table at the bottom of this page to guide your decision. Be aware that this feature may cease to work at any time.
« SVG Attribute reference home
The xlink:href
attribute defines a link to a resource as a reference <IRI>. The exact meaning of that link depends on the context of each element using it. See above for more specific usage.
Note: SVG 2 removed the need for the xlink
namespace, so instead of xlink:href
you should use href
.
The following elements can use the xlink:href
attribute
xlink:href
attribute is not provided, then the target element will be the immediate parent element of the current animation element.<linearGradient>
or <radialGradient>
element within the current SVG document. Any <linearGradient>
or <linearGradient>
attributes which are defined on the referenced element which are not defined on this element are inherited by this element if this element is of the same type as the referenced element. If this element has no defined gradient stops, and the referenced element does (possibly due to its own xlink:href
attribute), then this element inherits the gradient stop from the referenced element. Inheritance can be indirect to an arbitrary level; thus, if the referenced element inherits attribute or gradient stops due to its own xlink:href
attribute, then the current element can inherit those attributes or gradient stops. On the gradient elements, the xlink:href
attribute is animatable.<a>
<a>
element, the xlink:href
attribute is animatable.<altGlyph>
<glyph>
element in an SVG document or to an <altGlyphDef>
element.<glyph>
element and that glyph is available, then that glyph is rendered instead of the character(s) that are inside of the <altGlyph>
element.<altGlyphDef>
element, then if an appropriate set of alternate glyphs is located from processing the <altGlyphDef>
element, then those alternate glyphs are rendered instead of the character(s) that are inside of the <altGlyph>
element.<color-profile>
<cursor>
<cursor>
element, the xlink:href
attribute is animatable.<feImage>
<feImage>
element, the xlink:href
attribute is animatable.<filter>
<filter>
element within the current SVG document. Any attributes which are defined on the referenced <filter>
element which are not defined on this element are inherited by this element. If this element has no defined filter nodes, and the referenced element has defined filter nodes (possibly due to its own xlink:href
attribute), then this element inherits the filter nodes defined from the referenced <filter>
element. Inheritance can be indirect to an arbitrary level; thus, if the referenced <filter>
element inherits attributes or its filter node specification due to its own xlink:href
attribute, then the current element can inherit those attributes or filter node specifications. On the <filter>
element, the xlink:href
attribute is animatable.<font-face-uri>
xlink:href
attribute specifies the location of the referenced font.<glyphRef>
<glyph>
element in an SVG document. The referenced <glyph>
is rendered as an alternate glyph.<image>
<image>
element, the xlink:href
attribute is animatable.<mpath>
<path>
element which defines the motion path.<pattern>
<pattern>
element within the current SVG document. Any attributes which are defined on the referenced element which are not defined on this element are inherited by this element. If this element has no children, and the referenced element does (possibly due to its own xlink:href
attribute), then this element inherits the children from the referenced element. Inheritance can be indirect to an arbitrary level; thus, if the referenced element inherits attributes or children due to its own xlink:href
attribute, then the current element can inherit those attributes or children. On the <pattern>
element, the xlink:href
attribute is animatable.<script>
<textPath>
<path>
element onto which the text will be rendered. On the <textPath>
element, the xlink:href
attribute is animatable.<use>
<use>
element, the xlink:href
attribute is animatable.<tref>
<tref>
element. On the <tref>
element, the xlink:href
attribute is animatable.
© 2005–2018 Mozilla Developer Network and individual contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/xlink:href