It is currently Sat Dec 02, 2017 4:06 pm Advanced search
SVG files can be embedded into HTML documents with the <embed> tag, the <object> tag, or the <iframe> tag.
Right, but you can point to an SVG file in data="".haka wrote:The content of <object> is for alternate HTML or <param>. You cant put invalid HTML-code in this tag.
http://www.whatwg.org/specs/web-apps/cu ... #the-embedhaka wrote:<embed> does not exists in official HTML specs.
This has been proposed (but without the CDATA), I think.haka wrote:I see a way to support different XML-code in non-modular XML and SGML with the script tag:
<script type="image/svg+xml"><![CDATA[
<svg>... </svg>
]]></script>
haka wrote:Is there somthing new about this task?
I don't understand what you're trying to say here...haka wrote:But what I found seems to be more difficult as I thought. To write <svg> directly in the HTML code by using text/html as content type wont be valid. And writing <svg> without CDATA inside a <script> element or something equal will cause other problems like the <script> element in SVG. An other, new element instead of the <script> or <object> wont work backward compatible. The <object> element has only the attribute 'data' which can be used backwards compatible, so its not a real good idea to use it with XML code.
The way to implement it is <![CDATA[ - if valid in text/html - or using HTML comments around the <svg> data or use XML namespaces to differ the SVG code from HTML.
XHTML will work, but when XHTML is supported widely we are all sitting on a bank to enjoy our evening of life.
<embed src="logo.svg">
<img src="logo.svg">
<object data="logo.svg" type="image/svg+xml" codebase="http://www.adobe.com/svg/viewer/install/" />
<svg src="file.svg" onload="function();"/>?
spmorr02 wrote:...XHTML.
Either way I did it I had to wrap my script in <![CDATA[ tags to make sure scripting worked properly.
Yes, but only when html5.enable is set to true. It also works in the IE9 tech preview.spmorr02 wrote:I've played around with this some so I'll tell you what I've found out.
In FF 3.6 you are already able to write <svg></svg> inline and serve the page as text/html.
... but doesn't make sense for the same svg on multiple pages and is kind of dodgy.
Yep.spmorr02 wrote:What I've been doing for cross-browser results is writing it inline and serving it as XHTML.
Yes.spmorr02 wrote:Either way I did it I had to wrap my script in <![CDATA[ tags to make sure scripting worked properly.
Yes, but only when html5.enable is set to true.
Yeah.H3g3m0n wrote:Is it actually expected HTML5 behavior that the embed tag pulls in width/height information from the SVG files?
Same is true for JPG images. They resize fine, no?H3g3m0n wrote:I could see it being an issue since the embedded element isn't necessary going to load in a decent time. So I'm not sure that it's a browser bug.
Hmm. You're right. I guess we should fix that. Filed http://www.w3.org/Bugs/Public/show_bug.cgi?id=9362H3g3m0n wrote:Ignoring the resizing stuff, The other problem with the embed element is that it doesn't seem to support onload.
That's possible already with embed/object, no?H3g3m0n wrote:Being able to src a SVG file directly would be fantastic.
You can do that with embed/object, no?H3g3m0n wrote:There are a bunch of handy use cases for it to, for example you could make 1 .svg button template and just change the text and colour and so on.
http://gnome-look.org/CONTENT/content-f ... hinies.svg
Users browsing this forum: No registered users and 1 guest