Moin,
BTW: die Breiten- und Höhenangaben des rect-Elements müssen dimensionslose Einheiten sein.
Nein, hier gehst Du wohl vom img-Element in HTML aus. SVG erlaubt die üblichen, auch aus CSS bekannten, Einheiten.
Korrekt. Zitat aus der SVG 1.1-Spezifikation des svg
-Elements:
Attribute definitions:
width = "<length>"
For outermost svg elements, the intrinsic width of the SVG document fragment. For embedded ‘svg’ elements, the width of the rectangular region into which the ‘svg’ element is placed. A negative value is an error (see Error processing). A value of zero disables rendering of the element. If the attribute is not specified, the effect is as if a value of 100% were specified.height = "<length>"
For outermost svg elements, the intrinsic height of the SVG document fragment. For embedded ‘svg’ elements, the height of the rectangular region into which the ‘svg’ element is placed. A negative value is an error (see Error processing). A value of zero disables rendering of the element. If the attribute is not specified, the effect is as if a value of 100% were specified.
Viele Grüße
Robert