A rectangle is represented in SVG by the <rect> element.
Attributes:
width.height.x.y.rx.ry.fill- color name or a hex color value.stroke- color of the border line.stroke-width- thickness of the border line.
<rect width="100" height="200" />
Offset in pixels:
<rect x="20" y="20" width="100" height="200" />
Offset in %:
<rect x="10%" y="10%" width="80%" height="80%" />
Fill the rectangle with a blue color and add a black stroke:
<rect
x="20"
y="20"
width="100"
height="200"
fill="blue"
stroke="black"
stroke-width="3" />
Rounded corners
<rect x="10" y="10" width="100" height="200" rx="5" ry="10" />
Andrew Dorokhov