The largest Interview Solution Library on the web


« Previous | 1 | 2 | 3 | Next »

HTML5 - SVG Line


Following is the HTML5 version of an SVG example which would draw a line using <line> tag:

<!DOCTYPE html>
<head>
<title>SVG</title>
<meta charset="utf-8" />
</head>
<body>
<h2>HTML5 SVG Line</h2>
<svg id="svgelem" height="200" xmlns="http://www.w3.org/2000/svg">
<line x1="0" y1="0" x2="200" y2="100"
<tyle="stroke:red;stroke-width:2"/>
</svg>
</body>
</html>

You can use style attribute which allows you to set additional style information like stroke and fill colors, width of the stroke etc.

This would produce following result in HTML5 enabled latest version of Firefox.

HTML5 SVG Line

« Previous | 1 | 2 | 3 | Next »


copyright © 2014 - all rights riserved by javatechnologycenter.com