A.9 Linking
Often, elements in SVG need to refer, or link, to one another. This is most common when visible elements on canvas use some of the definitions in defs. For example, if you have a rectangle filled with linear gradient, the rect element describes only the rectangle itself. Its gradient is described by a different element, called linearGradient, in the document’s defs, and the rectangle links to that gradient definition.
In order to be linkable, an element must have an id attribute whose value is unique inside this document. Inkscape provides unique ids for all elements automatically. The URL for linking to an element is simply its id preceded by a hash mark (#)—for example, #linearGradient2128. In order to use this URL from a style property, ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access