O'Reilly logo

Designing SVG Web Graphics by Andrew H. Watt

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

The Preliminaries of an SVG Document

An SVG image can be completely described in an SVG document (or document fragment). The source code that describes the image is the input to an SVG rendering engine (an SVG viewer).

If you were going to draw a picture, you would want to know the kind of medium you were going to use, the tools you had available, and the size of the paper. The preliminaries of an SVG document provide much the same basic information to the SVG viewer. The XML declaration confirms what type of medium (syntax) will be used. The DOCTYPE declaration defines the allowed elements (tools, if you like). The <svg> element, called the document element, has attributes that define the size of the SVG canvas (or at least the size of the ...

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