svg src code example

Example 1: svg with src in html

<object data="algerie.svg" type="image/svg+xml"></object>

Example 2: add svg to html

<!-- external svg -->
<img src="mySvgImage.svg" />

<!-- internal svg example -->
<svg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg">
  <rect width="100" height="100" x="50" y="50"/>
</svg>

Example 3: html img svg

<img
    src="equilateral.svg"
    alt="un triangle aux trois côtés égaux"
    height="87px"
    width="100px" />

Example 4: using svg in html

<img src="image.svg" />

Tags:

Html Example