svg is not working on IIS webserver on localhost

后端 未结 5 1512
天命终不由人
天命终不由人 2020-12-14 14:30

I\'m trying to set a \".svg\" image as background-image using css, but it is not working. The url is valid and returns 200 status code and works on \".png\" images.

5条回答
  •  一向
    一向 (楼主)
    2020-12-14 15:24

    Your IIS is most likely not configured with SVG as a content type, try adding

    
        
    
    

    inside the scope of your web.config.

    This will of course only work if your application is the one serving up the svg. If the svg is not contained inside your application but in a separate directory of the web server, you'll need to add the same mapping to your web server instead inside the "mime-types" tab.

提交回复
热议问题