transform-style

Chris Coyier on

Get affordable and hassle-free WordPress hosting plans with Cloudways — start your free trial today.

The transform-style property, when applied to an element, determines if that element’s children are positioned in 3D space, or flattened.

.parent {transform-style: preserve-3d;}

It accepts one of two values: flat (the default) and preserve-3d. To demonstrate the difference between the two values, click the toggle button in the CodePen below:

When the button is clicked, the demo uses JavaScript to toggle the transform-style value between preserve-3d and flat.

As you can see, when the value is changed to flat, the child elements are no longer stacked according the the translateZ values (in 3D space), but instead flatten out to appear the way elements are by default on an HTML page.

Browser support

IEEdgeFirefoxChromeSafariOpera
No 1All10 212 34 315 3
Android ChromeAndroid FirefoxAndroid BrowseriOS SafariOpera Mobile
AllAll3 33.2 362
Source: caniuse

1 Internet Explorer 10 supports 3D transforms, but does not support the transform-style property.
2 Supported in Firefox 10-15 with prefix -moz-
3 Supported in Chrome 12-35, Safari 4-8, Safari iOS 3.2-8.4, and Opera 15-22 with prefix -webkit-