11.3.1. Style attribute

Dia

11.3.1. Style attribute

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 of butt, round, square, projecting (a synonym for square), or default.
  • stroke-linejoin - The line join style. One of miter, round, bevel or default.
  • stroke-pattern - The dash pattern. One of none, dashed, dash-dot, dash-dot-dot, dotted or default.
  • 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 names foreground, fg, default, background, bg inverse, text or none, 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 of default and inverse are exchanged. By default, elements are not filled, so to get the default fill, use "fill: default"
[Tip]Tip

So to draw a rectangle with a hairline stroke, the following would do the trick:

<svg:rect style="stroke-width: 0" x="..." y="..." width="..." height="..."/>

Ordinates x and y grow as in Dia.