【发布时间】:2014-08-08 18:43:31
【问题描述】:
我有一个graphics.svg 文件,其中包含以下代码:
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg width="400" height="110">
<rect width="400" height="110" style="fill:rgb(0,0,255);" />
</svg>
如果我从网络浏览器(Firefox、Chromium)打开该文件,则不会显示矢量图像。相反,文件以 XML 格式显示:
This XML file does not appear to have any style information associated with it. The document tree is shown below.
<svg width="400" height="110">
<rect width="400" height="110" style="fill:rgb(0,0,255);"/>
</svg>
这是因为svg文件应该嵌入到html文件中才能正常显示吗?
【问题讨论】: