Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/78.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
HTML5行无法使用svg_Html_Svg_Line - Fatal编程技术网

HTML5行无法使用svg

HTML5行无法使用svg,html,svg,line,Html,Svg,Line,我试图学习HTML5,所以我得到了代码并尝试了它,但我有一个问题,我能够得到正确的圆圈,但线并没有显示。我试着在Chrome Firefox和IE上打开它,但circle的浏览器显示线都没问题 代码是- <svg xmlns="http://www.w3.org/2000/svg" height="200" id="ls"> <line id="ls" x1="0" y1="0" x2="200" y2="100" style="stroke"red; stroke-width

我试图学习HTML5,所以我得到了代码并尝试了它,但我有一个问题,我能够得到正确的圆圈,但线并没有显示。我试着在Chrome Firefox和IE上打开它,但circle的浏览器显示线都没问题

代码是-

<svg xmlns="http://www.w3.org/2000/svg" height="200" id="ls">
<line id="ls" x1="0" y1="0" x2="200" y2="100" style="stroke"red; stroke-width:100" />
</svg>


您有一个输入错误:style=“stroke”红色

正确的代码是(注意(分号):


​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​

在这里拉小提琴:

您在
样式中有一个额外的双引号
属性:

style="stroke"red; stroke-width:100"
style="stroke"red; stroke-width:100"