• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 2. SVG Document Overview > The Preliminaries of an SVG Document

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 part of it on which this image will be rendered). With those three pieces of information available, an SVG viewer then has the basic information to be able to render an SVG image onscreen. Let’s take a closer look at how these elements are used in practice.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint