0 added
0 removed
Original
2026-01-01
Modified
2026-03-09
1
<p>There are several ways to draw a shape in SVG, where simple shapes have their own tags.</p>
1
<p>There are several ways to draw a shape in SVG, where simple shapes have their own tags.</p>
2
<p>For example, you can draw a rectangle using the rect tag. The code for a simple rectangle looks like this:</p>
2
<p>For example, you can draw a rectangle using the rect tag. The code for a simple rectangle looks like this:</p>
3
<rect width="150" height="100"/><p>Please note: All of the tags in the SVG must be closed. That is, they should look like this: <rect .../> or like this: <rect ...></rect>. We will use the first method.</p>
3
<rect width="150" height="100"/><p>Please note: All of the tags in the SVG must be closed. That is, they should look like this: <rect .../> or like this: <rect ...></rect>. We will use the first method.</p>
4
<p>Result:</p>
4
<p>Result:</p>
5
<p>The width and height attributes control the shape’s width and height, respectively. Values can be specified either using pixels or percentages.</p>
5
<p>The width and height attributes control the shape’s width and height, respectively. Values can be specified either using pixels or percentages.</p>
6
<p>For pixel values, you do not need to write px after the value, because pixels are the default unit of measurement in SVG. Percentages are calculated relative to the dimensions of the entire SVG image, where horizontal values are relative to width and vertical values are relative to height.</p>
6
<p>For pixel values, you do not need to write px after the value, because pixels are the default unit of measurement in SVG. Percentages are calculated relative to the dimensions of the entire SVG image, where horizontal values are relative to width and vertical values are relative to height.</p>
7
<p>In modern browsers, the size and position of shapes cannot be controlled via CSS, but this will be possible in the future.</p>
7
<p>In modern browsers, the size and position of shapes cannot be controlled via CSS, but this will be possible in the future.</p>