Web Developer's Virtual Library: Encyclopedia of Web Design Tutorials, Articles and Discussions


WDVL Newsletter

Active Server Pages
JSP/Java Servlets
Microsoft SQL Server
Daily Backup
Dedicated Servers
Streaming Audio/Video
24-hour Support    

jobs.webdeveloper.com

Hiermenus


e-commerce
Partner With Us















Developer Channel
FlashKit.com
JavaScript.com
JavaScriptSource
Developer Jobs
ScriptSearch
StreamingMediaWorld
Web Developer's Journal
Web Developer's Virtual Library
WebDeveloper.com
Webreference
Web Hosts
XMLfiles.com

internet.com
IT
Developer
Internet News
Small Business
Personal Technology

Search internet.com
Advertise
Corporate Info
Newsletters
Tech Jobs
E-mail Offers


SVG Basic Example

September 6, 1999

Let's try a simple example that displays 2 images and a text string.

<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg SYSTEM "SVG-19990812.dtd">
<!-- local DTD so we aren't subject to changes in draft -->

<svg width="300" height="300" >
  <image xlink:href="WDVL.jpg" x="30" y="30" 
  width="431" height="82" />
  <text style="font-size:48; stroke: blue" x="120" 
  y="170">SVG Rules!</text>
  <image xlink:href="internetcom.jpg" x="170" y="85" 
  width="200" height="27" />
</svg>
	

This example will be rendered as shown in this screen capture. Several things to note here are:

  • We're referencing a local copy of the August 12, 1999 SVG DTD just to be sure nothing changes that we care about (since it is still a Working Draft).
  • Even though we have two distinct images, we can position them so that they appear to be one image. The stacking order is determined by order in the file; the last listed image appears to be on top.
  • Text font size and color are controlled by the style attribute. Note that the word stroke rather than color is used to specify font color.
  • The gray background is an artifact of the SVG viewer used, not the image itself.

SVG Graphics Elements
Doing It With SVG (Scalable Vector Graphics), Part 1
SVG Example with Pizzazz


Up to => Home / Authoring / Languages / XML / SVG / DoingIt




Jupiter Online Media: internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and Jupiter Online Media

Jupitermedia Corporate Info


Legal Notices, Licensing, & Permissions, Privacy Policy.

Web Hosting | Newsletters | Tech Jobs | Shopping | E-mail Offers