1.

How To Draw A Rectangle In Svg?

Answer»

'rect' tag of SVG is used to draw a rectangle. Following are the commonly used attributes:

  • x − x-axis co-ordinate of top left of the rectangle. Default is 0.
  • y − y-axis co-ordinate of top left of the rectangle. Default is 0.
  • width − width of the rectangle.
  • HEIGHT − height of the rectangle.
  • RX − used to ROUND the CORNER of the rounded rectangle.
  • ry − used to round the corner of the rounded rectangle.

Example:

<rect 
x = "100" y = "30" 
width = "300" height = "100" 
style = "fill:rgb(121,0,121);stroke-width:3;stroke:rgb(0,0,0)" >

'rect' tag of SVG is used to draw a rectangle. Following are the commonly used attributes:

Example:

<rect 
x = "100" y = "30" 
width = "300" height = "100" 
style = "fill:rgb(121,0,121);stroke-width:3;stroke:rgb(0,0,0)" >



Discussion

No Comment Found