svg在浏览器中的图像位置

时间:2014-08-14 16:16:55

标签: html css image svg

我试图在文本后面的网页左上角找到一张SVG图像。不确定问题是什么,感谢任何帮助。

<html lang="en">
<head>
    <title>test SVG</title>
    </head>
<body>
    This is the top of the screen
      <br />
<object type="image/svg+xml"
        width="612px" height="792px" viewBox="0 0 612 792"
        preserveAspectRatio="xMinYMin meet"
        data="http://www.chordsandguitar.com/forms/forms-minor11.svg"
        <!-- your browswer cannot display this image -->
</object>

链接是:http://www.chordsandguitar.com/forms/test.htm

似乎无论我做什么,浏览器(Firefox)都没有响应,我试过宽度和高度= 100%preserveaspectratio =&#34;无&#34;,图像外观没有区别。

由于

1 个答案:

答案 0 :(得分:0)

好的,我的问题与svg属性无关,它与svg文件的创建方式有关。我正在使用adobe illustrator CS4,Illustrator中的图像必须位于插图画布的左上角,以获得我期望的结果。也许我可以使用svg属性翻译图像但是没有意义。

顺便说一句,这里是一个很好的解释视口/视箱的工作方式:

http://sarasoueidan.com/blog/svg-coordinate-systems/