Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining

symbol element | SVGSymbolElement object

Defines graphical template objects that a use element can instantiate.

Scalable Vector Graphics: Document Structure, Section 5.11.7Internet Explorer 9


DOM Information

Inheritance Hierarchy



The SVGSymbolElement object has these types of members:


The SVGSymbolElement object has these events.


Occurs when the browser has fully parsed the element and all of its descendants.



The SVGSymbolElement object has these properties.



Gets the names of the classes that are assigned to this object.


Sets or retrieves a reference to the SVG graphical object that will be used as the clipping path.


Gets a value that indicates whether referenced resources that are not in the current document are required to correctly render a given element.


Determines if an element can acquire keyboard focus (that is, receive keyboard events) and be a target for field-to-field navigation actions (such as when a user presses the Tab key).


Sets or retrieves a value that indicates a SVG mask.


Gets the nearest ancestor svg element.


Gets an XML value that indicates whether to force uniform graphic scaling.


Gets a style object.


Gets a value that indicates how a graphic scales to fit a container element.


Gets the element that established the current viewport.


Gets or sets the base attribute on the element.


Gets or sets a value that specifies the language that is used in the contents and attribute values of an element.


Gets or sets a value that indicates whether white space is preserved in character data.


Standards information


Note  In addition to the attributes, properties, events, methods, and styles listed above, SVG elements also inherit core HTML attributes, properties, events, methods, and styles.

Use symbol elements for graphics that are used multiple times in the same document to add structure and semantics. Documents that are rich in structure can be rendered graphically, as speech or braille, and promote accessibility.

Compared to a g element, the symbol element itself is not rendered. Only instances of a symbol element (that is, a reference to a symbol by a use element) are rendered.

The symbol element has viewBox and preserveAspectRatio attributes that enable a symbol to scale-to-fit within a rectangular viewport that the referencing use element defines.

The display property does not apply to the symbol element. Thus, symbol elements are not directly rendered even if you set the display property to a value other than none. symbol elements are available for referencing even when you set the display property on the symbol element or any of its ancestors to none.


In the following code example, a symbol is created and displayed in two different sizes. Copy this sample to a text file and save it with the .html file extension. Run it in Internet Explorer 9 to see the symbols.

The symbols will look like this:

symbol element example

    <!-- Create SVG container. -->
    <svg width="400" height="400">
      <!-- Definitions -->
        <!-- Define symbol for fill. -->
        <symbol id="mySymbol" viewBox="0 0 50 50"
						x="0" y="0" width="10" height="10" >
          <!-- Create path for individual symbol. -->
          <path d="M 0 10 L 25 30 L 50 30 Z" stroke="darkorchid" 
						stroke-width="3" fill="cornflowerblue" />
      <!-- Insert symbol twice. -->
      <use x="50" y="50" width="50" height="50" 
				xlink:href="#mySymbol" />
      <use x="50" y="100" width="100" height="100" 
				xlink:href="#mySymbol" />

See also




© 2015 Microsoft