CSS transform-style Property
Description
The transform-style property controls whether an element’s transformed children participate in a shared three-dimensional rendering context or are visually flattened into the plane of the element. In practical terms, it determines how nested transforms combine: when children retain their own 3D positions relative to one another, depth and rotation effects applied on descendants can be seen together as part of a coherent 3D scene. When children are flattened, their transforms are collapsed into the parent’s plane, so nested depth and overlapping order no longer produce a continuous 3D composition.
This behavior becomes important whenever you apply a transform to elements that contain other transformed descendants. If the children are preserved in three dimensions, their individual transforms accumulate and are projected relative to any perspective or viewing transform higher in the tree. If they are flattened, those descendant transforms are effectively combined into a single two-dimensional result before any ancestor-level projection takes place. That distinction changes how rotations, translations along the Z axis, and 3D stacking appear to the user.
The interaction with ancestor-level projection is another key consideration. When an ancestor provides a perspective, whether descendants are preserved as 3D objects or flattened affects whether that perspective is applied to each child’s 3D position or only to the parent’s flattened composite. Designers working with layered, nested 3D effects (for example, multi-part 3D widgets or card stacks with independent rotations) need the preserved 3D behavior to maintain believable depth relationships; simple two-dimensional effects and single-plane transformations are often simpler and cheaper to render when flattening is used.
Finally, consider performance and compositing consequences. Preserving nested 3D contexts often forces browsers to create additional compositing layers and can trigger GPU acceleration, which improves visual smoothness for complex animations but may increase memory and rendering overhead. The property itself is only about visual rendering — it does not change document layout or flow — so its primary effects are visual composition, the way transforms of nested elements combine, and how those results interact with perspective and other rendering-related properties.
Definition
- Initial value
- flat
- Applies to
- Transformable elements
- Inherited
- No
- Computed value
- Same as specified value
- Animatable
- No
- JavaScript syntax
- object.style.transformStyle
Interactive Demo
Parent
rotate3d(1, 1, 1, 45deg)Syntax
transform-style: flat | preserve-3d
Values
- flatChild elements will not preserve their 3D position before applying a transform.
- preserve-3dChild elements will preserve their 3D position before applying a transform.
Example
Browser Support
The following information will show you the current browser support for the CSS transform-style property. Hover over a browser icon to see the version that first introduced support for this CSS property.
This property is supported by all modern browsers.
Desktop
Tablets & Mobile
Last updated by CSSPortal on: 1st January 2026
