[whatwg] How to use SVG in HTML5?

James Graham jg307 at cam.ac.uk
Wed Jan 23 06:24:34 PST 2008


David Gerard wrote:
> Forgive me if this is a simple and obvious question. I note that all
> current browsers (except IE, of course) implement SVG rendering (to a
> better or worse degree). I'd like to be able to drop SVG images into
> an HTML page as easily as I can a JPEG or PNG. I read over the
> recently-released HTML5 draft and couldn't work out how I'd do this.
> 
> What would the HTML to do this look like? What's the equivalent of
> <IMG SRC="foo.jpg"> for foo.svg?

In browsers which support it <img src="foo.svg"> will work (with certain 
limitations for security reasons). If you want to embed svg inline like you can 
with XHTML, that's not currently supported, although several people have 
expressed an interest in changing that. However there are significant technical 
barriers to overcome at the syntax/parser level.

-- 
"Eternity's a terrible thought. I mean, where's it all going to end?"
  -- Tom Stoppard, Rosencrantz and Guildenstern are Dead



More information about the whatwg mailing list