Each of the SVG drawing elements understands the style attribute. The attribute should be of the form:
<svg:whatever style="name1: value1; name2: value2; ... name42: value42"/>
Currently only the following style attributes are understood:
-
stroke-width
- The width of the line, relative to the user specified width. -
stroke-linecap
- The line cap style. One ofbutt
,round
,square
,projecting
(a synonym forsquare
), ordefault
. -
stroke-linejoin
- The line join style. One ofmiter
,round
,bevel
ordefault
. -
stroke-pattern
- The dash pattern. One ofnone
,dashed
,dash-dot
,dash-dot-dot
,dotted
ordefault
. -
stroke-dashlength
- The length of the dashes in the dash pattern, in relation to the user selected value (default
is a synonym for 1.0). -
stroke
- The stroke colour. You can use one of the symbolic namesforeground
,fg
,default
,background
,bg inverse
,text
ornone
, or use a hex colour value of the form#rrggbb
. -
fill
- The fill colour. The same values as for stroke are used, except that the meaning ofdefault
andinverse
are exchanged. By default, elements are not filled, so to get the default fill, use "fill: default
"
Tip | |
---|---|
So to draw a rectangle with a hairline stroke, the following would do the trick:
|
Ordinates x and y grow as in Dia.