HTML SVG
What is SVG?
SVG stands for Scalable Vector Graphics. It is used to draw shapes, icons, charts and graphics using XML-based code.
Basic SVG Example
<svg width="200" height="200"> <circle cx="100" cy="100" r="50" fill="red" /> </svg>
Example
<svg width="200" height="200"> <rect width="150" height="100" fill="blue" /> </svg>
Common SVG Shapes
- <circle> – Circle shape
- <rect> – Rectangle
- <line> – Line
- <ellipse> – Oval shape
- <polygon> – Multi-side shape
Advantages of SVG
- Scalable without quality loss
- Lightweight
- Best for icons and logos
- Editable using code
Important Tip
SVG is resolution-independent, so it looks sharp on all screen sizes.