SVG has some predefined shape elements that can be used by developers:
The following chapters will explain each element, starting with the rect element.
The <rect> element is used to create a rectangle and variations of a rectangle shape:
Here is the SVG code:
For Opera users: View the SVG file (right-click on the SVG graphic to view the source).
Code explanation:
Let's look at another example that contains some new attributes:
Here is the SVG code:
For Opera users: View the SVG file (right-click on the SVG graphic to view the source).
Code explanation:
Define the opacity for the whole element:
Here is the SVG code:
For Opera users: View the SVG file (right-click on the SVG graphic to view the source).
Code explanation:
Last example, create a rectangle with rounded corners:
Here is the SVG code:
For Opera users: View the SVG file (right-click on the SVG graphic to view the source).
Code explanation:
Your message has been sent to W3Schools.