The image below demonstrates the <rect/> tag for drawing rectangles. These rectangles have horizontal and vertical sides. The attributes which determine the shape of the rectangle are given in the table at the bottom of the page.
1: <svg version="1.1" baseProfile="full" 2: xmlns="http://www.w3.org/2000/svg" 3: width="300px" height="200px" viewBox="0 0 300 200"> 4: 5: <rect x="10" y="10" width="280" height="100" fill="green" stroke="black" stroke-width="5px"/> 6: 7: </svg>
x | The smallest x-coordinate of a point in the rectangle. |
y | The smallest y-coordinate of a point in the rectangle. |
width | The difference between the largest x-coordinate of a point in the rectangle and the smallest x-coordinate. |
height | The difference between the largest y-coordinate of a point in the rectangle and the smallest y-coordinate. |