SVG and (X)HTML
From WHATWG Wiki
The way to do vector graphics on the Web is SVG.
Per http://lists.w3.org/Archives/Public/public-html/2007Nov/0487.html there are numerous ways to use SVG together with (X)HTML:
- For an SVG document that is an image or animated image, without interaction, embedding in
is suitable (this is supported in experimental builds of Opera and Safari).
- For an SVG document that is a purely presentational decuration, referencing as a CSS background image is suitable (this is supported in experimental builds of Opera and Safari).
- For an SVG document that supports rich interaction (and has more application-like properties) or that requires scripting interaction between the containing HTML document and the SVG, either <object> or <iframe> is suitable. This works today in the latest shipping versions of Safari, Opera and Firefox. <object> even works in IE with a suitable plugin installed.
- In XHTML, the <svg> element in the SVG namespace is a suitable way to embed any kind of inline SVG directly in the same document. Many are working on a design to let this work in HTML as well. See this research page.
- In both Classic and XML serializations of HTML, SVG content can be dynamically generated by script and inserted into the DOM at runtime, with an svg:svg element as root. This is perhaps closest to the way <canvas> operates. This is supported by Safari, Opera and Firefox and is used by popular JavaScript libraries, such as the Dojo charting toolkit.