--- title: SVGUseElement slug: Web/API/SVGUseElement translation_of: Web/API/SVGUseElement --- <div>{{APIRef("SVG")}}</div> <h2 id="SVG使用DOM接口"><font><font>SVG使用DOM接口</font></font></h2> <p><font><font>该</font></font><strong><code>SVGUseElement</code></strong><font><font>接口对应于</font></font>{{SVGElement("use")}}<font><font>元素。</font></font></p> <p>{{InheritanceDiagram(600, 140)}}</p> <h2 id="性质"><font><font>性质</font></font></h2> <p><em><font><font>此接口还从其父接口</font></font>{{domxref("SVGGraphicsElement")}} <font><font>继承属性,并从</font></font>{{domxref("SVGURIReference")}}<font><font>实现属性。</font></font></em></p> <dl> <dt>{{domxref("SVGUseElement.x")}} {{ReadOnlyInline}}</dt> <dd>An {{domxref("SVGAnimatedLength")}} corresponding to the {{SVGAttr("x")}} attribute of the given element.</dd> <dt>{{domxref("SVGUseElement.y")}} {{ReadOnlyInline}}</dt> <dd>An {{domxref("SVGAnimatedLength")}} corresponding to the {{SVGAttr("y")}} attribute of the given element.</dd> <dt>{{domxref("SVGUseElement.width")}} {{ReadOnlyInline}}</dt> <dd>An {{domxref("SVGAnimatedLength")}} corresponding to the {{SVGAttr("width")}} attribute of the given element.</dd> <dt>{{domxref("SVGUseElement.height")}} {{ReadOnlyInline}}</dt> <dd>An {{domxref("SVGAnimatedLength")}} corresponding to the {{SVGAttr("height")}} attribute of the given element.</dd> <dt>{{domxref("SVGUseElement.instanceRoot")}} {{ReadOnlyInline}}</dt> <dd>An {{domxref("SVGElement")}} corresponding to the instance root of the given element, which is a direct child of the elements shadow root. If the element does not have a shadow tree (for example, because its URI is invalid or because it has been disabled by conditional processing), then getting this attribute returns <code>null</code>.</dd> <dt>{{domxref("SVGUseElement.animatedInstanceRoot")}} {{ReadOnlyInline}}</dt> <dd>An {{domxref("SVGElement")}} corresponding to the instance root of the given element, which is a direct child of the elements shadow root. If the element does not have a shadow tree (for example, because its URI is invalid or because it has been disabled by conditional processing), then getting this attribute returns <code>null</code>.</dd> </dl> <h2 id="Methods">Methods</h2> <p><em>This interface doesn't implement any specific methods, but inherits methods from its parent interface, {{domxref("SVGGraphicsElement")}} and implements methods from {{domxref("SVGURIReference")}}.</em></p> <h2 id="规范">规范</h2> <table class="standard-table"> <thead> <tr> <th scope="col">Specification</th> <th scope="col">Status</th> <th scope="col">Comment</th> </tr> </thead> <tbody> <tr> <td>{{SpecName("SVG2", "struct.html#InterfaceSVGUseElement", "SVGUseElement")}}</td> <td>{{Spec2("SVG2")}}</td> <td>Redefined the properties <code>instanceRoot</code> and <code>animatedInstanceRoot</code>.</td> </tr> <tr> <td>{{SpecName("SVG1.1", "struct.html#InterfaceSVGUseElement", "SVGUseElement")}}</td> <td>{{Spec2("SVG1.1")}}</td> <td>Initial definition</td> </tr> </tbody> </table> <h2 id="浏览器兼容性"><font><font>浏览器兼容性</font></font></h2> <p>{{Compat("api.SVGUseElement")}}</p> <h2 id="参见"><font><font>参见</font></font></h2> <ul> <li>{{SVGElement("use")}}</li> </ul>