The transform-origin
SVG attribute sets the origin for an itemβs transformations.
Note: As a presentation attribute in SVG, transform-origin
corresponds in syntax and behavior to the transform-origin
property in CSS, and can be used as CSS property to style SVG. See the CSS transform-origin property for more information.
Usage notes
Values | [ <length-percentage> | left | center | right | top | bottom ] | [ [ <length-percentage> | left | center | right ] && [ <length-percentage> | top | center | bottom ] ] <length>? where |
Default value | 50%, 50% |
Animatable | Yes |
The transform-origin
property may be specified using one, two, or three values, where each value represents an offset. Offsets that are not explicitly defined are reset to their corresponding initial values.
If two or more values are defined and either no value is a keyword, or the only used keyword is center
, then the first value represents the horizontal offset and the second represents the vertical offset.
- One-value syntax:
- The value must be a
<length>
, a<percentage>
, or one of the keywordsleft
,center
,right
,top
, andbottom
.
- The value must be a
- Two-value syntax:
- One value must be a
<length>
, a<percentage>
, or one of the keywordsleft
,center
, andright
. - The other value must be a
<length>
, a<percentage>
, or one of the keywordstop
,center
, andbottom
.
- One value must be a
- Three-value syntax:
- The first two values are the same as for the two-value syntax.
- The third value must be a
<length>
. It always represents the Z offset.
Specifications
Specification | Status | Comment |
CSS Transforms Level 1 The definition of 'transform-origin' in that specification. |
Working Draft | |
Scalable Vector Graphics (SVG) 2 The definition of 'transform-origin' in that specification. |
Candidate Recommendation |