SVG (Scalable Vector Graphics) files

What is an SVG File?

An SVG (Scalable Vector Graphics) file is a text-based image format that describes vector graphics using XML code. Unlike JPEG or PNG, which store pixels, SVG describes shapes like lines, circles, and paths using mathematical instructions. This makes SVG images:

Example: SVG is Just Code

Here’s a simple SVG code for a blue circle:

<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg">
  <circle cx="50" cy="50" r="40" stroke="black" stroke-width="2" fill="skyblue" />
</svg>

You can save this text in a .svg file and open it in any browser.

Key Features of SVG

Example Use in HTML

<img src="icon.svg" alt="My Icon">

Or inline:

<svg width="50" height="50">
  <rect width="50" height="50" style="fill:#4B9CD3;" />
</svg>

Summary