Javatpoint Logo
Javatpoint Logo

SVG defs Element

The SVG <defs> element is used to embed definitions that can be reused inside an SVG image.

Using the SVG <defs> elements you can group SVG shapes together and reuse them as a single shape.

The shapes defined inside the <defs> element will be displayed when you reference it by a <use> element.


Test it Now


  • The id attribute of <g> defines a unique name.
  • The <use> element references the <g> element through its xlink:href attribute.
  • The # symbol defines the attribute value.
  • The <use> element is used to specify that where to show the reused shapes via its x and y attributes.

Next TopicSVG Symbol Element

Youtube For Videos Join Our Youtube Channel: Join Now


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Trending Technologies

B.Tech / MCA