Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

CSS3 transform-style Property

CSS3 transform-style Property

Example

Keep transformed child elements in 3D:

div

{

transform:

rotateY

(

60

deg

)

;

transform-style:

preserve-3d

; -

webkit-transform:

rotateY

(

60

deg

)

;

/*

Safari and Chrome

*/

webkit-transform-style:

preserve-3d

;

/*

Safari and Chrome

*/

}

Try it »


Browser support

The numbers in the table indicate the first browser version that supports this property.

A number immediately before -webkit-, -ms-, or -moz- indicates the first browser version that supports that prefixed property.

property
transform-style 36.0
12.0 -webkit- 11.0 16.0
10.0 -moz- 9.0
4.0 -webkit- 23.0
15.0 -webkit-

Property definition and usage

The transform-style property specifies how nested elements are rendered in three-dimensional space.

Note: To use this property, you must first use transform property.

**Safari/Chrome users:** to better understand the transform-style property, see the example Demonstrate.

Default value: flat
Inherited: no
Version: CSS3
JavaScript syntax: object.style.transformStyle="preserve-3d"

Syntax

transform-style: flat|preserve-3d;

Value Description
flat Indicates that all child elements are rendered in a 2D plane.
preserve-3d Indicates that all child elements are rendered in 3D space.