W3C home > Mailing lists > Public > whatwg@whatwg.org > January 2008

[whatwg] How to use SVG in HTML5?

From: Mathieu HENRI <p01@opera.com>
Date: Thu, 24 Jan 2008 13:29:27 +0100
Message-ID: <479884A7.5030601@opera.com>
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
Received on Thursday, 24 January 2008 04:29:27 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:00 UTC