Chapter 19. Scalable Vector Graphics (SVG)

This chapter describes Scalable Vector Graphics (SVG), an extremely versatile 2-D graphics format designed primarily for the Web. Its specification is defined and maintained by the World Wide Web Consortium (W3C), and it offers an open alternative to proprietary graphics systems.

Here you learn about the core concepts and some of the most commonly used features of SVG, along with corresponding practical code. The SVG specification is brimming with features—far too many to describe in a single chapter—but to come to grips with the language, you need to know how to write practical code and have a general idea of the kind of things SVG can do.

This chapter is divided into four sections:

  • An overview of SVG, including the kind of things it's good for and what tools are available to you, the developer

  • A hands-on section that demonstrates some of the basics of SVG in code examples

  • A simple but complete browser-based SVG application constructed using XHTML and SVG, as well as a script manipulating the XML DOM

  • A section-by-section summary of the contents of the SVG specification

The information in this chapter is quite densely packed, but once you start playing with SVG yourself, you will discover that not only is it easier to work with than it looks on the printed page, but it's also a lot of fun.

What Is SVG?

SVG is primarily a language for creating graphical documents. The language uses simple, intuitive terms such as circle and line, which makes it easy ...

Get Beginning XML, 4th Edition 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.