Easy Tutorial
❮ Svg Line Svg Examples ❯

SVG <rect>


SVG Shapes

SVG has some predefined shape elements that can be used and manipulated by developers:

The following sections will explain these elements, starting with the rectangle element.


SVG Rectangle - <rect>

Example 1

The <rect> tag is used to create a rectangle and variations of a rectangle shape:

Here is the SVG code:

Example

For Opera users: View SVG file (right-click on the SVG graphic to preview the source).

Code Analysis:


Example 2

Let's look at another example that includes some new attributes:

Example

For Opera users: View SVG file (right-click on the SVG graphic to preview the source).

Code Analysis:


Example 3

Defining the opacity of the entire element:

Here is the SVG code:

Example

For Opera users: View SVG file (right-click on the SVG graphic to preview the source).


Example 4

The last example, creating a rounded rectangle:

Here is the SVG code:

Example

For Opera users: View SVG file (right-click on the SVG graphic to preview the source).

❮ Svg Line Svg Examples ❯