Rectangles in SVG: <rect>

Defining rectangles in svg:

<svg xmlns=""
    viewBox="0 0 1000 200">

  <rect x="349" y="67"
      width="302" height="66"
      rx="5" ry="5"
      stroke-width="2" />


Breaking it down

Here are the properties used to define rectangles. If you omit rx and ry the corner radius will default to 0:

  • x & y: The x and y position of the top left corner of the rectangle.
  • width & height: The width and height of the rectangle.
  • rx & ry: Corner radius.
  Tweet It

🕵 Search Results

🔎 Searching...