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

Adjusting Margins and Leading with the dx and dy Attributes

Now that you're able to add text, and consistent blocks of text, you can investigate adding margins to your text. In certain cases, you may find that offsetting your text from an edge or indenting certain lines of text becomes necessary. To accomplish this, there are two optional attributes that can be added to the tspan element: dx and dy. Both of these attributes determine the offset of the leftmost edge of the baseline; dx moves the edge horizontally, and dy moves the baseline vertically. Each accepts only numerical values to determine the amount of offset.

One example of the use of these attributes is indenting the first line of a text block, similar to a newspaper or book's handling ...

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