Creative workflow
Rotate an SVG Element Around Its Own Pivot

An arm on a fictional North Pier diagram should stay attached to a pin. It slides away when rotated, even though the requested angle is right. We set the same origin and rotation on identical arms, and changed which reference box supplies the origin.
Quick answer
For a CSS transform on an SVG shape, set transform-box: fill-box when percentages should refer to the shape’s geometry. Set transform-origin explicitly to the point you want, then compare against a stationary guide.
1. Mark the intended hinge before rotating
In the example the orange pin marks the bottom center of the unrotated rounded rectangle. The two SVGs use the same viewBox and both ask for 50% 100% and 47 degrees of rotation. With view-box, the reference for 100% is the bottom of the viewport box used by the transform.
2. Choose the reference box for the moving part
With fill-box, 50% 100% is the bottom midpoint of the shape’s bounding box. Apply the CSS to the arm only and keep the pin as a separate sibling. If the pivot belongs to the stroke’s outer bounds, inspect stroke-box. For a joint at a known user-unit coordinate, consider an explicit SVG rotate(angle cx cy) transform.
3. Test motion at the target sizes
Compare several angles. The attachment should stay at the pin as the far end travels. Repeat with the graphic embedded as it will be shipped and remember that CSS transforms on the whole SVG element can use a different box from CSS on its children.
Start with the reference

Compare the two proofs in Ciyo
We imported the two proofs into a private production Ciyo project at the same scale and used Select to drag the comparison into place. This board shows the externally rendered or measured outputs for review.
The view-box version swings away from its orange anchor. The fill-box version stays attached at the lower tip of the arm.

Example files
Sources and related reading
Frequently asked questions
Why is center not always the shape’s center?
Percentages are relative to the reference box in use. Set both the reference box and the origin on the moving element.
Can I use the same method for a group?
You can use its bounding box when the group’s bounds define the intended joint. Use an explicit pivot if changing the children must leave the hinge fixed.
Review a second version on the canvas
Keep both proofs at the same size and put the exact difference you reviewed in the handoff.