Knowledge baseExam Center
ENEnglish
Choose language13

CKTIS / CSS

transform-style — preserving descendant depth

The transform-style property controls whether descendants are flattened or share a three-dimensional rendering space.

Version: CSS modules; structured CSSWG indexes reconciled with pinned MDN BCD; Chromium 152 scope gate, per-example verification still required

Syntax

transform-style: flat | preserve-3d;

transform-style applies to transformable elements. The initial flat flattens descendants into the element’s plane; preserve-3d preserves a shared 3D space.

The property is not inherited: also set preserve-3d on intermediate containers that must preserve depth. It neither rotates elements nor adds perspective itself.

Grouping values such as opacity: 0.5 or overflow: hidden force the used value to flat, despite computed preserve-3d. overflow: clip does not force this flattening.

Examples

<!doctype html>
<meta charset="utf-8">
<title>transform-style</title>
<style>
  body { display: flex; gap: 80px; padding: 60px; }
  .scene { perspective: 500px; }
  .group { width: 100px; height: 100px; transform: rotateY(45deg); }
  .depth { transform-style: preserve-3d; }
  .tile { width: 100px; height: 100px; background: teal; transform: translateZ(60px); }
</style>
<div class="scene">flat<div class="group"><div class="tile"></div></div></div>
<div class="scene">preserve-3d<div class="group depth"><div class="tile"></div></div></div>

Result

flat: flattened tile; preserve-3d: tile displaced in depth.

The displayed code and declared result were verified in an isolated environment using the method recorded in the verification evidence for this exact version.

Sources