XML technologies / SVG / Creating simple SVG graphics / The structure of SVG graphics / Inserting SVG graphics into HTML pages / The EMBED tag
(Excerpt from “Das Einsteigerseminar SVG — Webgrafiken mit XML” by Helma Spona)
To insert an SVG graphic using the <EMBED> tag, use this syntax:
<EMBED src="Bsp01.svg" type="image/svg-xml"/>The src attribute names the image file to display. The type attribute specifies the file type. For an svg file, specify type="image/svg-xml". Since the <EMBED> tag has no closing tag, follow XML and XHTML conventions and end it with />.
Note:
You can omit the type specification and SVG will still display correctly. HTML and XHTML standards nevertheless recommend specifying type.
If SVG and HTML files are in different directories, the src attribute can specify a relative or absolute file path.
Note:
To provide text or graphics when the visitor’s browser supports no plug-ins, insert within the <EMBED> tag a <NOEMBED> tag containing the alternative contents.
Although the <EMBED> tag is outside W3C standards, Adobe recommends it for SVG because most browsers support it better than the <OBJECT> tag. Adobe’s website provides scripts checking for the plug-in and offering its download. This still leaves no alternative content and depends on visitors installing it. Sun Microsystems provides a better solution here: its plug-in checking scripts can redirect to a page without SVG.
Copyright © verlag moderne industrie GmbH 2001
You may print the online version for your private use.
Otherwise, this chapter from “Das Einsteigerseminar SVG — Webgrafiken mit XML” is subject to the same conditions as the bound edition. The work, including all its parts, is protected by copyright. All rights reserved, including reproduction, translation, microfilming, and storage and processing in electronic systems.
verlag moderne industrie GmbH, Justus-von-Liebig-Straße 1, D-86899 Landsberg/Lech, fon ++49 (0) 81 91 / 125 – 0, leserservice(at)mi-verlag.de
back to top