Embed SVG into HTML

Method 1: <img> tags

<img
  src="equilateral.svg"
  alt="triangle with all three sides equal"
  height="87"
  width="100"
/>

Embed the SVG directly into an image tag.

Method 2: In-line SVG

<svg width="300" height="200">
  <rect width="100%" height="100%" fill="green" />
</svg>

Embed the SVG in-line with the HTML.

Method 3: <iframe>

<iframe src="triangle.svg" width="500" height="500" sandbox>
  <img src="triangle.png" alt="Triangle with three unequal sides" />
</iframe>

Related