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

F. Using SVG with Other XML Applications > Referring to an SVG Document in HTML

Referring to an SVG Document in HTML

OK, so we lied. HTML isn’t an XML application, but you’ll still want to put SVG graphics in a web page. For most browsers, this is done by using a plug-in. As of this writing, Adobe’s SVG viewer plugin is available for Windows and Macintosh systems. To have a plug-in display in an SVG file within an HTML document, you use the <embed> element. The src attribute specifies the file in which the SVG resides, and the width and height attributes tell how much screen space to reserve for the graphic. The graphic will be centered in the space that you specify. You must also specify a type attribute with a value of image/svg+xml.

<embed src="some_file.svg" width="100" height="200"
    type="image/svg+xml" />

PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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