473,385 Members | 1,320 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Embeding SVG in HTML

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
2 3161
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Mark Watson | last post by:
While converting my main web site opening page to XHTML yesterday, I was a little shocked to find out that there is no standard way to embed RDF directly in XHTML and still have XHTML validate. ...
2
by: BigOne | last post by:
I'm looking for a script that embeds the text typed on a hidden(and protected) page in to a other page that can be viewed for visitors this text must stay till the owner sets a new text this is...
3
by: Mike Smith | last post by:
I have an application which is similar in function to Setup.exe. The user downloads it, uses it once in most cases and throws it away. I am trying to coax .NET into making it one file and it is...
4
by: Francois Keyeux | last post by:
hello everyone: i have a web site built using vbasic active server scripting running on iis (it works on either iis 50 and 60, but is designed for iis 50) i know how to create a plain text...
4
by: twosk | last post by:
Hi, I have a question, because i cannot find any information in online docs (maybe i'm just blind :P). I'm want to build application with embedded database, but i also need a possibility to...
2
by: Raj Dhrolia | last post by:
Hi Everyone, I have some HTML snippets (with about 15 HTML controls) that needs to be embedded into my server control. I need these HTML controls on client side for some processing (JS). What...
1
Death Slaught
by: Death Slaught | last post by:
What am i doing wrong here? <html> <embed src="C:\Documents and Settings\Owner\My Documents\My Videos\video.MSWMM" width=400 height=500> </embed> </html>
1
by: chazzy69 | last post by:
I know that you can echo html in a .php page, but can you echo html with a javascript aswell? For example Just html echo '<p>' . "hello world" . '</p>'; Then with javascript
1
by: tokcy | last post by:
Hi, I am embeding flash player in my site but i have some problem like... suppose i have 5 songs and i am playing one song but i want to play another while first one is not completed then both...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.