rect

The rect SVG element specifies a rectangle which is axis-aligned with the current user coordinate system.

Rounded rectangles can be achieved by setting non-zero values for the rx and ry geometric properties.

Syntax

Attributes

height

Specifies the height of the element.

Value
auto | <length-percentage>
Default
auto

pathLength

Specifies the total length of the path in user units.

Value
<number>
Default
(none)

rx

Specifies the x-axis of the corner radius of the element.

Value
auto | <length-percentage>
Default
auto

ry

Specifies the y-axis of the corner radius of the element.

Value
auto | <length-percentage>
Default
auto

width

Specifies the width of the element.

Value
auto | <length-percentage>
Default
auto

x

Specifies the x-coordinate of the element.

Value
<length-percentage>
Default
0

y

Specifies the y-coordinate of the element.

Value
<length-percentage>
Default
0

Examples

height

auto

<length-percentage>

pathLength

<number>

rx

auto

<length-percentage>

ry

auto

<length-percentage>

width

auto

<length-percentage>

x

<length-percentage>

y

<length-percentage>

Internal

circle

ellipse

line

polygon

polyline

External

World Wide Web Consortium (W3C)

Home Menu