HTML5 svg无法正常工作 [英] HTML5 svg not working

查看:59
本文介绍了HTML5 svg无法正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的是Chrome版本5.0.375.55和Firefox版本3.5.9,但是我无法获取下面的HTML5代码来显示一个框.

I'm using Chrome version 5.0.375.55 and Firefox version 3.5.9 but I can't get the HTML5 code below to display a box.

<!DOCTYPE html> <!-- this tells browser, this is HTML5 -->
<html>
<body>
 <svg width="200" height="200"> 
 <rect
  x="0" y="0"
  width="100" height="100"
  fill="blue" stroke="red"
  stroke-width="5px"
  rx="8" ry="8"
  id="myRect" class="chart" />
 </svg>
</body>
</html>

以下网站指出我的浏览器支持HTML5和svg,那有什么用呢?

The following sites stated that my browsers support HTML5 and svg so what gives?

http://caniuse.com/
http://www.html5test.com/

推荐答案

这就是我的工作方式我将文件命名为 test.xhtml

This is how I got it to work I called the file test.xhtml

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
</head>
<body>
<svg xmlns="http://www.w3.org/2000/svg" width="200" height="200"> 
 <rect
  x="0" y="0"
  width="100" height="100"
  fill="blue" stroke="red"
  stroke-width="5px"
  rx="8" ry="8"
  id="myRect" class="chart" />
 </svg>
</body>
</html>

祝你好运!

这篇关于HTML5 svg无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆