SVG - Rectangle (rect)

Card Puncher Data Processing

About

To draw a rectangle, you can use:

Example

With rect without fill

The rect element without the fill attribute is black.

<svg >
<rect 
    x="0" 
    y="0" 
    width="300" 
    height="100" 
    rx="10"
    ry="10"/>
</svg>

With rect and fill

The rect element

<svg >
<rect 
    x="0" 
    y="0" 
    width="300" 
    height="100" 
    fill="#ECDCC6" 
    rx="10"
    ry="10"/>
</svg>

With Path

with the path element

<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg">
  
  <path d="M10 10 H 90 V 90 H 10 L 10 10" fill="#ECDCC6" />

  <!-- Points -->
  <circle cx="10" cy="10" r="2" fill="red"/>
  <circle cx="90" cy="90" r="2" fill="red"/>
  <circle cx="90" cy="10" r="2" fill="red"/>
  <circle cx="10" cy="90" r="2" fill="red"/>

</svg>

Documentation / Reference





Discover More
Card Puncher Data Processing
Datacadamia - Data all the things

Computer science from a data perspective
Inkscape Rect
Inkscape - Rectangle

in Inkscape A rectangle is a shape.
Card Puncher Data Processing
SVG - Fill

This page is the fill operation in SVG. It shows you how to paint the interior of the object via: the SVG fill attribute and the HTML style property With the rect element
Card Puncher Data Processing
SVG - Path

in Svg. Path is the generic element to define a shape. polylines The shape of a path element is defined by one attribute: d that contains a suite of . All of the commands also come in two variants....
Card Puncher Data Processing
SVG - Shape and Path

The representation of geometric object (shape) in svg. They are in the grammar. You need to use the path element to create them
Card Puncher Data Processing
SVG - Translate transformation

The Translate transform definition specifies a translation by x and y. If Y is not provided, it is assumed to be zero. This is equivalent to matrix(1 0 0 1 X Y). Ie See NI letters made of...



Share this page:
Follow us:
Task Runner