You are here: Home > SVG Elements > line element
Introduction
The line element is used to draw a line.
Details
Usage
<line x1="50" y1="50" x2="200" y2="100" fill="green" />
Attributes
Common attributes:
- x1 - the x-coordinate of the first point of the line. Defaults to 0.
- y1 - the y-coordinate of the first point of the line. Defaults to 0.
- x2 - the x-coordinate of the second point of the line. Defaults to 0.
- y2 - the y-coordinate of the second point of the line. Defaults to 0.
- stroke - describes how the line should be painted, see SVGStrokeProperties. The default value is "none".