SVG won't display

前端 未结 2 1491
猫巷女王i
猫巷女王i 2020-12-11 20:48

I\'m trying to get this simple code to work:


    

        
                      
相关标签:
2条回答
  • 2020-12-11 21:29

    I was experiencing the first of the problems described by @r3mainer.

    On my lighttpd server the problem was caused by the missing

      ".svg"          =>      "image/svg+xml",
    

    line in the mimetype.assign section of the lighttpd configuration file.

    0 讨论(0)
  • 2020-12-11 21:34

    I can think of four possibilities:

    1. Your server is using the wrong MIME type for SVG images. (Can be fixed by adding AddType image/svg+xml svg to your .htaccess file; other methods discussed here)

    2. You saved the SVG file somewhere else and it doesn't exist at icons/chrome.svg. (Try navigating straight to the SVG file at icons/chrome.svg. Does it display in your browser?)

    3. You saved the file with insufficient permissions, resulting in your web server being unable to access the file. (Can be fixed by navigating to the icons directory and typing chmod 0644 chrome.svg at the command line prompt.)

    4. The file you downloaded from nocookie.net isn't actually an SVG file at all. (Try opening it inside a text editor.)

    0 讨论(0)
提交回复
热议问题