O'Reilly logo

The Book of Inkscape by Dmitry Kirsanov

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

A.4 Defs, View, and Metadata

Now let’s descend from the root element of a typical Inkscape SVG document to see what else is in there.

First comes the defs element. As part of the SVG standard, it is a storage bin for things that, by themselves, are not displayed on the canvas, but may be used by other elements that are. This includes gradients, patterns, markers (arrowheads, 9.5 Markers), clipping paths, masks, filters, and so on. They are all stored as child elements of the defs element. The SVG specification allows arbitrarily many defs elements placed almost anywhere in the document, but Inkscape always uses a single defs under the root svg. Here’s an example defs element containing a gradient:

<defs id="defs4"> <linearGradient inkscape:collect="always" ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required