Chrome not rendering SVG referenced via

后端 未结 21 1630
孤独总比滥情好
孤独总比滥情好 2020-11-29 02:35

I am having issues with google chrome not rendering svg with an img tag. This happens when refreshing the page and initial page load. I can get the image to show up by \"

21条回答
  •  一生所求
    2020-11-29 03:19

    I had a similar problem and the existing answers to this either weren't applicable, or worked but we couldn't use them for other reasons. So I had to figure out what Chrome disliked about our SVGs.

    In our case in turned out to be that the id attribute of the symbol tag in the SVG file had a : in it, which Chrome didn't like. Soon as I removed the : it worked fine.

    Bad:

    
        
            
            ...
            
        
        
    
    

    Good:

    
        
            
            ...
            
        
        
    
    

提交回复
热议问题