[whatwg] How to use SVG in HTML5?
Mathieu HENRI
p01 at opera.com
Thu Jan 24 04:29:27 PST 2008
Charles McCathieNevile wrote:
> On Thu, 24 Jan 2008 04:19:37 +1100, Mathieu HENRI <p01 at opera.com> wrote:
>
>> James Graham wrote:
>>> David Gerard wrote:
>>>> ... 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...
>>
>> Supporting <img src="foo.svg"> is a requirement of SVG 1.1 [1]
> ...
>
> It is true that you can't use inline markup. As far as I know, <img
> src="foo.svg"> is only supported in Opera 9.5 betas (maybe webkit
> nightlies, I forget). It's also bad HTML, since it lacks any kind of
> fallback.
>
> But you can use <object data-"foo.svg"></object> (again bad HTML, it
> should generally have some kind of fallback content - and a size).
> Unfortunately, of course, IE is still holding you back from doing it on
> the open web that simply :(
<object data="foo.svg"><object data="foo.png">Smells like Lynx
spirit.</object></object>
> cheers
>
> Chaals
>
--
Mathieu 'p01' HENRI
JavaScript developer, Opera Software ASA
More information about the whatwg
mailing list