SVG line Element (original) (raw)
Last Updated : 31 Mar, 2022
The SVG element is used to draw line. The start point and endpoints are given to draw the line.
Syntax:
<line x1="x-axis co-ordinate" y1="y-axis co-ordinate"
x2="x-axis co-ordinate"
y2="y-axis co-ordinate" >
Attribute:
- x1: x-axis start point.
- y1: y-axis start point.
- x2: x-axis end point.
- y2: y-axis end point.
Example:
html `
SVG Line`
Output:
Example: Change opacity of the line.
html `
SVG Line`
Output: