L
L
Limpus2019-02-19 16:36:34
SVG
Limpus, 2019-02-19 16:36:34

Why doesn't SVG work in Chrome?

Hello! I can’t help but figure out why SVG in Chrome doesn’t work.
To insert, I use the following method:

<svg>
  <use xlink:href="img/icons.svg#icon-list"></use>
</svg>

The test svg itself:
<svg xmlns="http://www.w3.org/2000/svg">
  <symbol id="icon-list" viewBox="0 0 24 24">
    <path d="M3,13h2v-2H3V13z M3,17h2v-2H3V17zM3,9h2V7H3V9z M7,13h14v-2H7V13z M7,17h14v-2H7V17z M7,7v2h14V7H7z"></path>
  </symbol>
</svg>

I get the following error in the console
: Unsafe attempt to load URL

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
A person from Kazakhstan, 2019-02-19
@LenovoId

Lay out the sprite in html
It says that svg is in the img folder ... is it so?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question