![]() |
VOOZH | about |
SVG stands for Scalable Vector Graphic. It can be used to make graphics and animations like in HTML canvas.
The SVG <symbol> element is used to define graphical template objects which can be instantiated by the <use> element. The use of symbol elements for graphics that are used multiple times in the same document adds structure and semantics.
Syntax:
<symbol attribute="" > content Here </symbol>
Attribute:
Output: A dot symbol.
👁 ImageExample 2:
<!DOCTYPE html>
<html>
<body>
<svg viewBox="0 0 80 20"
xmlns="http://www.w3.org/2000/svg">
<symbol id="circ"
width="10"
height="10"
viewBox="0 0 2 2">
<rect height="10" width="10" />
</symbol>
<use xlink:href="#circ" x="5"
y="5" opacity="0.5" fill="green"/>
</svg>
</body>
</html>
Output:
👁 ImageSupported Browsers: The following browsers are supported by this SVG element: