transform-box

Defines the bounding box that a transform (like a rotation or scale) is relative to. This is especially important for SVG elements where you might want to rotate an object around its own center instead of the SVG's top-left corner.

svg .gear {
  transform-origin: center;
  /* Ensures the gear rotates around its own center, not the SVG viewport coordinate (0,0) */
  transform-box: fill-box;
  transform: rotate(45deg);
}
Initial value
view-box
Inherited
No
Applies to
transformableElements
Animation type
discrete

Values

content-boxborder-boxfill-boxstroke-boxview-box
Newly available Since 2024 95% global usage

Since 2024 this feature works across the latest devices and browser versions. This feature might not work in older devices or browsers.

Works in all modern browsers. May need a fallback for older browsers.

64+
55+
11+
79+
ESC