HTML5 line not working using svg

I tried to learn HTML5 to get the code and try it, but I have a problem that I can get the circle correctly, but the line is not displayed. I tried to open it in Chrome Firefox and IE, but none of the display windows in the browser were okay!

Code -

<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> 

What is the problem?

+4
source share
2 answers

you have a typo: style = "stroke" red;

correct code (mind (semi)):

 <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>​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​ 

fiddle here: http://jsfiddle.net/s9sat/

+4
source

You have an extra double quote in the style attribute:

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

All Articles