SVG xlink:href无法在Chrome中运行

时间:2018-06-01 13:47:40

标签: svg

我是SVG的新手。我试图在我的页面上放置一个带有可链接区域(如图像映射)的SVG文件,并使其响应。 SVG显示,但可链接区域在Chrome中不起作用。在FF,IE11和Edge中正常工作。

<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 880 371" style="enable-background:new 0 0 880 371;" xml:space="preserve">
  <g id="Background_xA0_Image_1_">
    <image style="overflow:visible;" width="880" height="371" id="Background_xA0_Image" xlink:href="data:image/jpeg;... />
    </image>
  </g>
  <g id="Layer_2_xA0_Image_1_">
    <a id="Layer_2_xA0_Image" xlink:href="http://www.example.com"  transform="matrix(1 0 0 1 572 215)">
    <image style="overflow:visible;" width="195" height="42" xlink:href="data:image/png;...>
    </image>
    </a>
  </g>
  <g id="Layer_1_xA0_Image_1_">
    <a id="Layer_1_xA0_Image" xlink:href="http://www.anotherexample.com"  transform="matrix(1 0 0 1 308 164)">
    <image style="overflow:visible;" width="137" height="46" xlink:href="data:image/png;...>
    </image>
    </a>
  </g>
</svg>

我正在处理我在Photoshop中切片然后从Illustrator导出到SVG的JPG文件。这是它生成的代码。

1 个答案:

答案 0 :(得分:0)

刚刚实现了svg中的元素是clickabel - 问题实际上是光标没有改变样式所以我认为它不起作用。

我在链接中添加了 DB::query('INSERT INTO users VALUES (\'\ ',:username, :password, :email)', array(':username'=>$username, ':password'=>password_hash($password, PASSWORD_BCRYPT), ':email'=> $email)); echo 'Success'; ,现在看起来很不错。