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

Hour 16. Formatting > Adjusting Margins and Leading with the dx and dy Attribut...

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 of text. To try such an alteration, take Listing 16.3 as a starting point. Because an indentation in the left edge of the text would entail only a horizontal move of the first line, you only need to add a dx element to your first tspan element (see line 7 in Listing 16.4).


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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