SVG 'tref' element

The <tref> element is used to reference the text that is defined within the <defs> element. All character data within the referenced element, including character data enclosed within additional markup, will be rendered. You can use the referenced text multiple times in your SVG image, without having it included into the code more than once. The <tref> element has the following attributes:

  • xlink:href
  • attribute defines a URI reference to a fragment within an SVG document.

Here is a simple example:

<svg xmlns="" version="1.0"
<text id="Textref">
The text to be referenced to

<text x="20" y="20" font-size="48" fill="#9d1d20" >
Inline text

<text x="20" y="40" font-size="48" fill="red" style="text-decoration:underline;">
<tref xlink:href="#Textref"/>

Here is the resulting text: