1.

How to draw a line in SVG?

Answer»

'line' tag of SVG is used to draw a line. Following are the commonly used attributes −

  • x1 − x-axis co-ordinate of the start point. Default is 0.

  • y1 − y-axis co-ordinate of the start point. Default is 0.

  • x2 − x-axis co-ordinate of the end point. Default is 0.

  • y2 − y-axis co-ordinate of the end point. Default is 0.

Example −

<line x1 = "20" y1 = "20" x2 = "150" y2 = "150" stroke = "black" stroke-width = "3" fill = "rgb(121,0,121)">


Discussion

No Comment Found