The <svg>
element in
<svg width="x" height="y"> shape_tags... </svg>
The <svg>
element can draw multiple shapes with different attributes. Here are some elements to draw different shapes like circles, ellipses, polygons etc.
Tag | Attribute | Description |
<rect /> | width and height | Generates multiple shapes like squares, rectangles, etc. |
<polygon /> | points | Generates polygons like stars, pentagons, etc. |
<ellipse /> | cx, cy, rx, and ry | Draws ellipse-like shapes. |
<circle /> | cx, cy, and r | Draws circles of every shape. |
Using the <svg>
element in lines 7, 12, and 17 generates a circle, rectangle, and star, respectively. The objects or SVG images are of different widths and heights, with a black border and filled red color.