Is it possible to manipulate SVG rect's borders in the same way as it border-left-width
, border-right-width
and so on does?
Asked
Active
Viewed 1.6k times
15

Vasiliy Ermolovich
- 24,459
- 5
- 79
- 77
-
What do you mean by the rect's borders? Do you mean the stroke properties? That definitely can't be done. I'm pretty sure you can't selective change the left or right parts of the rect (other than their position). – Peter Collingridge Jul 16 '11 at 18:29
-
Yes, I mean the stroke properties of the borders. You can put it as the answer and I'll accept it. – Vasiliy Ermolovich Jul 16 '11 at 18:49
2 Answers
15
try this and change it as yours.
<svg width="400" height="110">
<rect width="300" height="100" style="fill:rgb(0,0,255);stroke-width:3;stroke:rgb(0,0,0)" />
</svg>

chionite
- 151
- 1
- 2
-
1Can you control which side has the border? e.g if someone only wanted a border on the top, left and right. – Jevon Nov 27 '22 at 19:52
11
Since you asked, the answer, I'm afraid is no. If you want to selectively change the sides of a rectangle, you'll have to draw it as four separate lines.

Peter Collingridge
- 10,849
- 3
- 44
- 61