sample svg image code example

Example 1: html svg

<svg width="100" height="100">  <!-- Draws a circle -->
  <circle cx="50" cy="50" r="40" stroke="green" stroke-width="4" fill="yellow" />
</svg>
<svg width="400" height="100">  <!-- Draws a rectangle -->
  <rect width="400" height="100" style="fill:rgb(0,0,255);stroke-width:10;stroke:rgb(0,0,0)" />
</svg>
<svg width="300" height="200">  <!-- Draws a star -->
  <polygon points="100,10 40,198 190,78 10,78 160,198"
  style="fill:lime;stroke:purple;stroke-width:5;fill-rule:evenodd;" />
</svg>

Example 2: how to add an svg image to html

<body>

<img src="blabla.svg" alt="blabla_is_working">

</body>

Example 3: when svg file invented

1998
SVG was developed by the W3C SVG Working Group starting in 1998, after six competing vector graphics submissions were received that year: Web Schematics, from CCLRC.

Tags:

Misc Example