A.8 Style

Quite naturally, the style properties of an object can be represented as attributes of the corresponding element. Such attributes are called presentation attributes. For example, this rectangle has blue fill and black stroke 1 px wide:

<rect id="rect2310"
      y="350"
      x="100"
      width="300"
      height="150"
      fill="blue"
      stroke="black"
      stroke-width="1pt" />

This, however, is only one possible way to record style properties in XML. Another way is to pack all the properties into a single attribute, called style, using colons (:) to separate the name from the value in each property and semicolons (;) to separate properties:

<rect id="rect2310"
      y="350"
      x="100"
      width="300"
      height="150"
      style="fill:blue; stroke:black; stroke-width:1pt" />

Inkscape understands ...

Get The Book of Inkscape now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.