简体   繁体   中英

Svg image not showing in chrome

I worked on this project a couple months ago and it worked fine. I open it up today and the svg images are not showing on chrome. It does show in other browser though. This is how I'm using them..

 <svg>
     <use xlink:href=“img/sprite.svg#icon-user”></use>
</svg>

Your code looks fine. Although you could shorten <use> with self closing tag:

<svg>
    <use xlink:href=“img/sprite.svg#icon-user”/>
</svg>

Could it be that your image was moved/deleted/renamed and other browsers are just caching it?

You state it's visible in one browser but not another, so that indicates that the image is where it should be. Is there any possibility of any CSS affecting "icon-user"?

Which browser works and which doesn't? Having more detail may help lead to an answer for you.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM