How to Understand the Basics of SVG

SVG stands for Scalable Vector Graphics. Most modern web browsers support SVG. SVG is used, as the name suggests, to create graphics for display on the web. SVG is a web standard recognized and supported by the World Wide Web Consortium (W3C). The following steps will cover the basics.

Things You'll Need

  • Basic knowledge of HTML
  • Basic knowledge of XML
Show More

Instructions

    • 1

      SVG uses the markup language XML to define vector-based graphics on the web. The graphics are pure XML, they are not images in the sense that you may be used to with JPEG or GIF images. In other words, you can create SVG images with nothing more complicated than Notepad and some XML.

    • 2

      Because of the scalable part of SVG, the graphics can be reduced or zoomed and never lose any of their quality.

    • 3

      Since SVG images are defined with XML, any element in the graphic can be identified in the XML and animated. At first glance, you might not be able to tell an SVG animation from a Flash animation. The difference is that SVG is an open source technology that uses accepted standards such as the Document Object Model (DOM) to manipulate the image.

    • 4
      Circle.svg

      Here's an example. I'll make a graphic of a circle. The image shows a small SVG file, saved as circle.svg. The DOCTYPE is an SVG DTD. The circle has a radius of 40px, a 3px red stroke and a blue fill. This is XML, so all tags must be closed.

    • 5
      The Circle in a Browser

      In an SVG compliant browser, here's how that looks.

    • 6

      The cx is the x-axis of the circle, the cy is the y-axis of the circle. With a circle, you can actually omit these two and simply use the r, which is radius. (With an ellipse, you would need the x and y axis.) Fill, stroke and stroke-width are self-explanatory.

    • 7

      The shapes include rect (rectangle), circle, ellipse, line, polyline, and polygon.

    • 8

      The graphic defined in the SVG file is inserted into an HTML file with either an embed tag (deprecated) and object tag or in an iframe. Simply point back to the .svg file for the source of the object.

    • 9
      A Path Tag

      A path tag is used to animate an object. The path in the image moves the object from a starting point to several positions and then closes the path. Here are the possible path commands: M=moveto, L=lineto, H= horizontal lineto, V=vertical, C=curveto, S=smooth curveto, Q=quadratic Belzier curve, T=smooth quadratic Belzier curveto, A=elliptical Arc and Z=closepath.

Tips & Warnings

  • This article just touches on some of the basic concepts involved in SVG. See Resources below for additional links to information.

  • Internet Explorer will not display SVG graphics without a plugin such as the Adobe SVG Viewer.

Related Searches:

Resources

Comments

You May Also Like

  • How to Open .svg Files

    SVG stands for "Scalable Vector Graphics." The World Wide Web Consortium created the vector graphic format for images on the Web. Some...

  • How to Create Frames in PDF

    Adobe Acrobat's portable document format lets you create documents that are easily deployed to different types of media, such as the Internet...

  • How to Convert a SVG File to PDF Format

    Scalable Vector Graphics (SVG) is the International Standard fro two-dimensional vector and mixed vector/rastor graphics in XML. Commonly, it is desirable to...

  • How to Convert SVG to Corel

    Scalable Vector Graphics (SVG) is a text-based computer language that can describe vector graphics in XML code. Unlike bitmaps that are made...

  • How to Make EXE Files Using Notepad

    An "exe" file is an executable file or a program file. To create an "exe" file in Notepad, you must understand and...

  • How to Create a Quadratic Graph

    A quadratic graph, the graph of a parabola, is used in physics, engineering, video game design and sports. And one of the...

  • How to Make Your Own Haunted House

    Create the spookiest entertainment on the block, and terrify children and adults alike on Halloween night. If it turns out to be...

  • What Is the File Extension SVG?

    SVG is the file extension for Scalable Vector Graphics. This text-based language is used to create compact, high-quality graphics for web, print,...

  • How to Throw a Vampire Party

    With the popularity of the movie "Twilight" and the series "New Moon," you need to throw a vampire party. No need to...

  • How to Make a Signature File in Thunderbird

    Email signatures have a long tradition on the net. Back in the dark days when images were too large to send easily,...

Related Ads

Featured