이 문서는 아직 자원 봉사자들이 한국어로 번역하지 않았습니다. 참여해서 번역을 마치도록 도와 주세요!
English (US)의 문서도 읽어보세요.

The <use> element takes nodes from within the SVG document, and duplicates them somewhere else.

<svg viewBox="0 0 30 10" xmlns="http://www.w3.org/2000/svg">
  <circle id="myCircle" cx="5" cy="5" r="4"/>
 
  <use href="#myCircle" x="10" fill="blue" />
  <use href="#myCircle" x="20" fill="white" stroke="blue" />
</svg>

The effect is the same as if the nodes were deeply cloned into a non-exposed DOM, and then pasted where the use element is, much like cloned template elements in HTML5. Since the cloned nodes are not exposed, care must be taken when using CSS to style a use element and its hidden descendants. CSS attributes are not guaranteed to be inherited by the hidden, cloned DOM unless you explicitly request it using CSS inheritance.

For security reasons, some browsers could apply a same-origin policy on use elements and could refuse to load a cross-origin URI within the href attribute.

Since SVG 2, the xlink:href attribute is deprecated in favor of simply href. See xlink:href page for more information.

Attributes

href
This attribute defines the URL to element/fragment that needs to be duplicated.
Value type: <URL> ; Default value: none; Animatable: yes
x
This attribute defines the x coordinate of the use element.
Value type: <coordinate> ; Default value: 0; Animatable: yes
y
This attribute defines the y coordinate of the use element.
Value type: <coordinate> ; Default value: 0; Animatable: yes
width
This attribute determines the width of the use element.
Value type: <length> ; Default value: 0; Animatable: yes
height
This attribute determines the height of the use element.
Value type: <length> ; Default value: 0; Animatable: yes

Note: Starting with SVG2 x, y, width and height are Geometry Properties, meaning those attributes can also be used as CSS properties for that element.

Global attributes

Core Attributes
Most notably: id, tabindex
Styling Attributes
class, style
Conditional Processing Attributes
Most notably: requiredExtensions, systemLanguage
Event Attributes
Global event attributes, Graphical event attributes
Presentation Attributes
Most notably: clip-path, clip-rule, color, color-interpolation, color-rendering, cursor, display, fill, fill-opacity, fill-rule, filter, mask, opacity, pointer-events, shape-rendering, stroke, stroke-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-opacity, stroke-width, transform, vector-effect, visibility
ARIA Attributes
aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-colindex, aria-colspan, aria-controls, aria-current, aria-describedby, aria-details, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, aria-labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-pressed, aria-readonly, aria-relevant, aria-required, aria-roledescription, aria-rowcount, aria-rowindex, aria-rowspan, aria-selected, aria-setsize, aria-sort, aria-valuemax, aria-valuemin, aria-valuenow, aria-valuetext, role
XLink Attributes
xlink:href, xlink:title

Usage  notes

CategoriesGraphics element, Graphics referencing element, Structural element
Permitted contentAny number of the following elements, in any order:
Animation elements
Descriptive elements

Specifications

Specification Status Comment
Scalable Vector Graphics (SVG) 2
The definition of '<use>' in that specification.
Candidate Recommendation  
Scalable Vector Graphics (SVG) 1.1 (Second Edition)
The definition of '<use>' in that specification.
Recommendation Initial definition

Browser compatibility

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidEdge MobileFirefox for AndroidOpera for AndroidiOS SafariSamsung Internet
Basic supportChrome Full support 22Edge Full support 12Firefox Full support 4
Notes
Full support 4
Notes
Notes For years, Firefox has suffered from a bug whereby it doesn't completely follow the use cascading rules (see bug 265894). A fix is documented by Amelia Bellamy-Royds on StackOverflow. The good news is that this is finally fixed as of Firefox 56.
IE Full support YesOpera Full support 11.5Safari Full support 3WebView Android Full support 4Chrome Android Full support YesEdge Mobile Full support 12Firefox Android Full support 4
Notes
Full support 4
Notes
Notes For years, Firefox has suffered from a bug whereby it doesn't completely follow the use cascading rules (see bug 265894). A fix is documented by Amelia Bellamy-Royds on StackOverflow. The good news is that this is finally fixed as of Firefox 56.
Opera Android Full support 11.5Safari iOS Full support 3Samsung Internet Android ?
Load from external URIChrome Full support 22Edge Full support 13Firefox Full support 4IE No support NoOpera Full support 11.5Safari Full support 6.1WebView Android Full support 4.4Chrome Android Full support YesEdge Mobile Full support 13Firefox Android Full support 4Opera Android Full support 11.5Safari iOS Full support 6.1Samsung Internet Android ?
Load from data: URIChrome Full support 22Edge Full support YesFirefox Full support 4IE No support NoOpera Full support 11.5Safari Full support 5.1WebView Android Full support 4Chrome Android Full support YesEdge Mobile Full support YesFirefox Android Full support 4Opera Android Full support 11.5Safari iOS Full support 5.1Samsung Internet Android ?
hrefChrome Full support YesEdge Full support YesFirefox Full support YesIE Full support YesOpera Full support YesSafari No support NoWebView Android Full support YesChrome Android Full support YesEdge Mobile Full support YesFirefox Android Full support YesOpera Android Full support YesSafari iOS No support NoSamsung Internet Android ?
xlink:href
Deprecated
Chrome Full support YesEdge Full support YesFirefox Full support YesIE Full support YesOpera Full support YesSafari Full support YesWebView Android Full support YesChrome Android Full support YesEdge Mobile Full support YesFirefox Android Full support YesOpera Android Full support YesSafari iOS Full support YesSamsung Internet Android ?
xChrome Full support YesEdge Full support YesFirefox Full support YesIE Full support YesOpera Full support YesSafari Full support YesWebView Android Full support YesChrome Android Full support YesEdge Mobile Full support YesFirefox Android Full support YesOpera Android Full support YesSafari iOS Full support YesSamsung Internet Android ?
yChrome Full support YesEdge Full support YesFirefox Full support YesIE Full support YesOpera Full support YesSafari Full support YesWebView Android Full support YesChrome Android Full support YesEdge Mobile Full support YesFirefox Android Full support YesOpera Android Full support YesSafari iOS Full support YesSamsung Internet Android ?
heightChrome Full support YesEdge Full support YesFirefox Full support YesIE Full support YesOpera Full support YesSafari Full support YesWebView Android Full support YesChrome Android Full support YesEdge Mobile Full support YesFirefox Android Full support YesOpera Android Full support YesSafari iOS Full support YesSamsung Internet Android ?
widthChrome Full support YesEdge Full support YesFirefox Full support YesIE Full support YesOpera Full support YesSafari Full support YesWebView Android Full support YesChrome Android Full support YesEdge Mobile Full support YesFirefox Android Full support YesOpera Android Full support YesSafari iOS Full support YesSamsung Internet Android ?

Legend

Full support  
Full support
No support  
No support
Compatibility unknown  
Compatibility unknown
Deprecated. Not for use in new websites.
Deprecated. Not for use in new websites.
See implementation notes.
See implementation notes.

문서 태그 및 공헌자

최종 변경자: Jeremie,