O'Reilly logo

Sams Teach Yourself SVG in 24 Hours by Micah Laaker

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

Text Boxes

Having successfully created multiline text, try selecting the text within your viewer's window. Just as in HTML, when your cursor nears text, it changes to an I-beam cursor, allowing you to select the type. You will notice in this case, though, that you are capable of selecting only one line of text, not both. This is because SVG viewers consider each text element to be a unique and independent chunk of text.

Naturally, you will have instances where you will want to create a continuous chunk of text (such as a paragraph to allow users to select and copy the whole text). To accommodate this, SVG offers a text subelement: tspan. The tspan element serves as a child of a master text element. This means that you can insert multiple tspan ...

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