Donner SVG Editor & Engine
SVG-native editor and embeddable SVG2 + CSS3 engine in C++20, with GPU (WebGPU) and compact CPU renderers, built for correctness, security, and performance.
Loading...
Searching...
No Matches
<a>

The <a> element creates a hyperlink around its child content.

It is a transparent grouping container: it draws nothing of its own and does not establish a new coordinate system, but its children render in-place exactly as if the <a> were not there.

Unlike <g>, <a> is allowed both inside and outside of text content. When it appears inside a <text> (or <tspan>) flow it behaves like a <tspan> - a text-content group whose text children participate in the surrounding text layout, and which supports the per-glyph positioning attributes x, y, dx, dy, and rotate. When it appears outside of text it behaves like a <g>, grouping arbitrary graphics elements.

The link target is given by href (or the legacy xlink:href). Donner has no interactive navigation, so the target is parsed and retained but does not affect rendering.

Attributes

Attribute Default Description
href (none) Link target retained on the DOM element. xlink:href is accepted as an alias.
x 0 Absolute X position(s) when the link participates in SVG text layout.
y 0 Absolute Y position(s) when the link participates in SVG text layout.
dx (none) Relative X shift(s) for linked text glyphs.
dy (none) Relative Y shift(s) for linked text glyphs.
rotate (none) Rotation values for linked text glyphs, in degrees.
textLength (none) Author-specified total advance length for linked text.
lengthAdjust spacing spacing or spacingAndGlyphs adjustment mode.
<text x="20" y="40">
<a href="https://www.w3.org/TR/SVG2/">SVG 2</a>
</text>