Embeding SVG in HTML

Discussion in 'XML' started by Sascha Kerschhofer, Jun 25, 2003.

  1. 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
    Sascha Kerschhofer, Jun 25, 2003
    #1
    1. Advertising

  2. Sascha Kerschhofer

    Red Ogden Guest

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

    Redge.

    "Sascha Kerschhofer" <> wrote in message news:<bdbffj$re3$>...
    > 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
    Red Ogden, Jun 25, 2003
    #2
    1. Advertising

  3. Sascha Kerschhofer

    Ed Beroset Guest

    Red Ogden wrote:
    > "Sascha Kerschhofer" <> wrote in message news:<bdbffj$re3$>...
    >
    >>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
    Ed Beroset, Jun 26, 2003
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Arne Nordmann
    Replies:
    0
    Views:
    503
    Arne Nordmann
    Jun 28, 2004
  2. Mardagg
    Replies:
    0
    Views:
    789
    Mardagg
    May 12, 2006
  3. Mardagg
    Replies:
    0
    Views:
    638
    Mardagg
    May 12, 2006
  4. milof83

    svg to svg saving problem

    milof83, Aug 18, 2006, in forum: Java
    Replies:
    1
    Views:
    800
    Roland de Ruiter
    Aug 18, 2006
  5. Helmut Jarausch

    Re: svg-chart 1.1 SVG Charting Library

    Helmut Jarausch, May 20, 2008, in forum: Python
    Replies:
    0
    Views:
    460
    Helmut Jarausch
    May 20, 2008
Loading...

Share This Page