O'Reilly logo

Sams Teach Yourself SVG in 24 Hours by Micah Laaker

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

Structure

The structure of an SVG document will seem very familiar to anyone who has looked at an HTML file before. The analogy works far better when referring to XHTML, as you saw when the previous section noted SVG's strict interpretation of code. Far from complex, the structure of SVG code is but a series of elements, some of which enclose other data.

In every SVG file, the content is enclosed with the svg element's tags: <svg>...</svg>. This is sometimes referred to as the document, or root, element. All your SVG content must appear between these two tags. The only data that should appear outside of these two tags will be XML data defining the document type and nature.

Thus, one of the simplest SVG documents that you can create is composed ...

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