SVG rect Element (original) (raw)

Last Updated : 17 Aug, 2024

The SVG element is used to create a rectangle. We can customize the rectangle shapes:

**Syntax


**Attributes

**Example:

html `

`

**Output:

**Example: Change the corner of the rectangle.

html `

<svg width="400" height="380">
    <rect x="80" y="20" rx="20" ry="20" 
        width="150" height="150" style="
            fill: orange; 
            stroke: black;
            stroke-width: 2; 
            opacity: 0.5" />
</svg>

`

Output: