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

The g Element

The purpose of the g element is to group SVG elements. A g element can contain nested within it graphic elements such as those described in Chapter 3. Additionally, a g element can also contain desc and title elements, which provide information about the content of the g element, thus facilitating accessibility. Accessibility is discussed in more detail in Chapter 13, “Accessibility, Internationalization, and Metadata.”

TIP

A g element and its associated nested SVG elements may be transformed. A transformation moves an object in some way on the screen, due to an alteration in the coordinate system (see Chapter 5). An svg element, whether the document element or a nested svg element, cannot be transformed. So, if you think it is likely that you will want to use SVG transformations, group elements using the g element rather than a nested svg element. Transformations are described in Chapter 7, “Transformations in SVG.”



PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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