# The SVG sprite icons are not working

**URL:** <https://forum.codewithmosh.com/t/the-svg-sprite-icons-are-not-working/2301>\
**Category:** HTML/CSS\
**Created:** [January 27, 2021, 8:37pm UTC](https://forum.codewithmosh.com/t/the-svg-sprite-icons-are-not-working/2301 "2021-01-27T20:37:52Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![mir001](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.codewithmosh.com/mir001/32/400_2.png) [@mir001](https://forum.codewithmosh.com/u/mir001)\
**Post date:** [January 27, 2021, 8:37pm UTC](https://forum.codewithmosh.com/t/the-svg-sprite-icons-are-not-working/2301/1 "2021-01-27T20:37:52Z")

</div>

Hi Mosh

The SVG sprite icons are not working if they are sourced from an external file.  
I invested 4 hours without any luck. Then I searched the mosh’s code of ‘Moshify’ project. SVG icons are not working for Mosh’s provided code as well.  
Please let me know how to fix this. Thank you.

---

<div class="post-metadata">

**Author:** ![Steph](https://avatars.discourse-cdn.com/v4/letter/s/22d042/32.png) [@Steph](https://forum.codewithmosh.com/u/Steph)\
**Post date:** [February 24, 2021, 11:29am UTC](https://forum.codewithmosh.com/t/the-svg-sprite-icons-are-not-working/2301/2 "2021-02-24T11:29:07Z")

</div>

I have the same problem!!!

---

<div class="post-metadata">

**Author:** ![SAM](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.codewithmosh.com/sam/32/167_2.png) [@SAM](https://forum.codewithmosh.com/u/SAM)\
**Post date:** [February 24, 2021, 5:44pm UTC](https://forum.codewithmosh.com/t/the-svg-sprite-icons-are-not-working/2301/3 "2021-02-24T17:44:34Z")

</div>

Do you have the same issue that is discussed in this thread?:

> [@HTML5 CSS3 Series Part 3|Lecture No 14: Icons](https://forum.codewithmosh.com/t/html5-css3-series-part-3-lecture-no-14-icons/2979):
>
> In lecture No 14: Icons I created a svg file named as sprite.svg I type but it is giving me an error that " Urls are treated as a unique security origins" and not displaying the output. It is not giving this error also not displaying the output. Can someone please tell me what is wrong with the code. I am on windows

---

<div class="post-metadata">

**Author:** ![Zalrish\_khan](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.codewithmosh.com/zalrish_khan/32/1000_2.png) [@Zalrish\_khan](https://forum.codewithmosh.com/u/Zalrish_khan)\
**Post date:** [February 25, 2021, 2:20am UTC](https://forum.codewithmosh.com/t/the-svg-sprite-icons-are-not-working/2301/4 "2021-02-25T02:20:12Z")

</div>

Yeah same issue just opened with live server. Why its giving error when i open it with chrome?

---

<div class="post-metadata">

**Author:** ![SAM](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.codewithmosh.com/sam/32/167_2.png) [@SAM](https://forum.codewithmosh.com/u/SAM)\
**Post date:** [February 25, 2021, 5:55am UTC](https://forum.codewithmosh.com/t/the-svg-sprite-icons-are-not-working/2301/5 "2021-02-25T05:55:44Z")

</div>

The problem is not the browser but the URL. If you open the file from the file system relative URLs in the document are `file://`-URLs while they are `http://`- or `https://`-URLs when hosted on a web server (like Live Server). `file://`-URLs are considered unsafe for many reasons so browsers apply several restrictions on them.

---

<div class="post-metadata">

**Author:** ![Zalrish\_khan](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.codewithmosh.com/zalrish_khan/32/1000_2.png) [@Zalrish\_khan](https://forum.codewithmosh.com/u/Zalrish_khan)\
**Post date:** [February 25, 2021, 10:08pm UTC](https://forum.codewithmosh.com/t/the-svg-sprite-icons-are-not-working/2301/6 "2021-02-25T22:08:05Z")

</div>

thankyou soo much 🙂
