Skip to content

Instantly share code, notes, and snippets.

@yorikvanhavre
Created April 13, 2012 22:31
Show Gist options
  • Save yorikvanhavre/2380563 to your computer and use it in GitHub Desktop.
Save yorikvanhavre/2380563 to your computer and use it in GitHub Desktop.
A typical, simple SVG example
Display the source blob
Display the rendered blob
Raw
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg width="5cm" height="4cm" version="1.1" xmlns="http://www.w3.org/2000/svg">
<desc>Examples of geometry</desc>
<!-- A border around our objects -->
<rect x=".01cm" y=".01cm" width="4.98cm" height="3.98cm" fill="none" stroke="#0000ff" stroke-width=".02cm" />
<!-- Four rectangles -->
<rect x="0.5cm" y="0.5cm" width="2cm" height="1cm"/>
<rect x="0.5cm" y="2cm" width="1cm" height="1.5cm"/>
<rect x="3cm" y="0.5cm" width="1.5cm" height="2cm"/>
<rect x="3.5cm" y="3cm" width="1cm" height="0.5cm"/>
<!-- A circle -->
<circle cx="2.5cm" cy="2.5cm" r="1cm" fill="#ff0000"/>
<!-- Two lines -->
<line x1="1cm" y1="1cm" x2="3cm" y2="3cm" stroke-width="5" stroke="#00ff00"/>
<line x1="2cm" y1="2cm" x2="3cm" y2="1cm" stroke-width="10" stroke="#ffff00"/>
</svg>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment