473,729 Members | 2,235 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 3183
One solution would be to dynamically generate the html file and hence
the height width attributes, using your SVG stylesheet.

Redge.

"Sascha Kerschhofer" <sk**********@y ahoo.de> wrote in message news:<bd******* ***@news.mch.sb s.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**********@y ahoo.de> wrote in message news:<bd******* ***@news.mch.sb s.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
1811
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. I saw some good ideas that involved linking, but without a standard, how are RDF spiders to find the RDF on the web? I ended up putting comment tags around my RDF (yuck!). At least my RDF spider peeks inside comments, but other
2
1299
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 to update a site of a restaurant and they want to chance just the "menu of the day" (one textline only) thanks in advance The BigOne
3
333
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 fighting me all the way. If I do a full build from my source files I get what I want, one exe file. The problem comes when build the program as a library and then try to make an exe file out of it. I have to add this extra step because the code...
4
2970
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 email by creating a text file, with content following certain format, and saving that file into the correct '..\mailroot\pickup' folder, and it is working fine
4
2636
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 have one global database, which can be accessed from internet (ability to synchronize between remote and local/embedded database). I heard from somone that i could use PostgreSQL, but I cannot find any information that confirms or denies it. And one...
2
1094
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 is the best way to implement this? One most straight forward way i can think of is to have something like - Response.Write("<long HTML string>");
1
1292
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
1355
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
1232
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 songs are playing that do not i want ... i want like at time only one shog should play. Is there any scripting to do this? I am giving the code which i have embed
0
8761
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9426
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8144
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6722
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6016
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4525
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3238
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2677
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2162
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.