VOOZH about

URL: https://www.geeksforgeeks.org/html/svg-line-element/

⇱ SVG line Element - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

SVG line Element

Last Updated : 31 Mar, 2022

The SVG <line> 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" > 
</line>

Attribute:

  • x1: x-axis start point.
  • y1: y-axis start point.
  • x2: x-axis end point.
  • y2: y-axis end point.

Example:

Output:

👁 Image

Example: Change opacity of the line.

Output:

👁 Image
Comment
Article Tags: