• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

The rect Element

The rect element defines a rectangular shape. The SVG rect element can be used to describe both a rectangle and a square. A square is simply a special case of a rectangle—one in which the width and height of the rectangle are equal.

To fully describe a rectangle in SVG, we need to define the coordinates of its top-left corner together with its width and height. Those key pieces of information are specified in the x, y, width, and height attributes, respectively, of the rect element.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint