By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,743 Members | 1,028 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,743 IT Pros & Developers. It's quick & easy.

Embeding SVG in HTML

P: n/a
Hi,

I am embeding my SVG Files in HTML in this way:
<OBJECT DATA="foo.svg" WIDTH="300" HEIGHT="200" TYPE="image/svg+xml"> (using
Acrobat SVG Viewer)
Since I create the SVG dynamicaly the WIDTH and HEIGHT is unknown, when
loading the HTML page. Can I embed SVG like I can do it with images without
defining WIDTH and HEIGHT. Simply "oversize" both attributes unnecessarily
produces scrollbars in the browser window.

Sascha Kerschhofer
Jul 20 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
One solution would be to dynamically generate the html file and hence
the height width attributes, using your SVG stylesheet.

Redge.

"Sascha Kerschhofer" <sk**********@yahoo.de> wrote in message news:<bd**********@news.mch.sbs.de>...
Hi,

I am embeding my SVG Files in HTML in this way:
<OBJECT DATA="foo.svg" WIDTH="300" HEIGHT="200" TYPE="image/svg+xml"> (using
Acrobat SVG Viewer)
Since I create the SVG dynamicaly the WIDTH and HEIGHT is unknown, when
loading the HTML page. Can I embed SVG like I can do it with images without
defining WIDTH and HEIGHT. Simply "oversize" both attributes unnecessarily
produces scrollbars in the browser window.

Sascha Kerschhofer

Jul 20 '05 #2

P: n/a
Red Ogden wrote:
"Sascha Kerschhofer" <sk**********@yahoo.de> wrote in message news:<bd**********@news.mch.sbs.de>...
Hi,

I am embeding my SVG Files in HTML in this way:
<OBJECT DATA="foo.svg" WIDTH="300" HEIGHT="200" TYPE="image/svg+xml"> (using
Acrobat SVG Viewer)
Since I create the SVG dynamicaly the WIDTH and HEIGHT is unknown, when
loading the HTML page. Can I embed SVG like I can do it with images without
defining WIDTH and HEIGHT. Simply "oversize" both attributes unnecessarily
produces scrollbars in the browser window.

Sascha Kerschhofer
One solution would be to dynamically generate the html file and hence
the height width attributes, using your SVG stylesheet.


There's another simple way to do it, which is to specify it like this:

<object data="foo.svg" width="100%" height="100%" type="image/svg+xml">

That way, no scroll bars will be shown and you'll get the SVG sized to
to the currently available area.

Ed

Jul 20 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.