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 ...

Get Designing SVG Web Graphics now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.