XML technologies / SVG / Creating simple SVG graphics / The structure of SVG graphics / The enclosing XML tag
(Excerpt from “Das Einsteigerseminar SVG — Webgrafiken mit XML” by Helma Spona)
After the DTD declaration comes the SVG file’s actual code. It always begins with <svg> and ends with </svg>. Between these tags, specify the file contents using any SVG-supported tags.
The opening <svg> tag can have attributes, for example to set the graphic’s dimensions in pixels. The next listing creates an empty 500 x 500 pixel graphic, using the attributes width and height in this line:
<svg width="500" height="500">These determine the dimensions.
Note:
Pixels are the default unit for sizes and lengths. You can also specify the unit explicitly, for example by writing <svg width="500px" height="500px">. Other units are available, as described in The coordinate system of SVG graphics. The dimensions given here determine the graphic’s size, but not necessarily its display size in the HTML page. If a different size is specified there, the entire graphic may not be visible.
Copyright © verlag moderne industrie GmbH 2001
You may print the online version for your private use.
Otherwise, this chapter from “Das Einsteigerseminar SVG — Webgrafiken mit XML” is subject to the same conditions as the bound edition. The work, including all its parts, is protected by copyright. All rights reserved, including reproduction, translation, microfilming, and storage and processing in electronic systems.
verlag moderne industrie GmbH, Justus-von-Liebig-Straße 1, D-86899 Landsberg/Lech, fon ++49 (0) 81 91 / 125 – 0, leserservice(at)mi-verlag.de
back to top