[SVG] How to draw a rectangle?
Copyright Notice: This article is an original work licensed under the CC 4.0 BY-NC-ND license.
If you wish to repost this article, please include the original source link and this copyright notice.
Source link: https://v2know.com/article/545
Previous: [SVG] How to draw a circle?
Code:
<svg >
<rect width="300" height="100" style="stroke:rgb(0,0,0);stroke-width:2;fill:transparent;" />
</svg>
<svg>
<rect width="300" height="100" stroke="black" stroke-width="2" fill="transparent" />
</svg>
Show results:
Why did I write two examples?
This is simply another way of writing that I want to tell you, which is written in "style", even though they are separate attributes.
stroke:rgb(0,0,0) ⇔ stroke=black
This is another way to show colors.
Next: [SVG] How to draw polygons?
This article was last edited at 2020-12-09 02:57:15