English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
transform-The style CSS attribute specifies that the child elements of the element are positioned in3whether it is tiled in D space or in the element plane. If flattened, the child elements will not exist independently in three-dimensional space.
This attribute only applies to elements withtransformSpecify the child elements of the attribute.
The following table provides usage instructions and version history of this attribute, as well as its usage syntax in JavaScript scripts.
Default value: | flat |
---|---|
Applies to: | Transformable elements |
Inheritance: | None |
Animatable: | No.Please see Animation properties. |
Version: | CSS3new feature |
JavaScript syntax: | object.style.transformStyle="preserve-3d" |
The syntax of this attribute is as follows:
transform-style: flat | preserve-3d | initial | inherit
The following examples demonstrate how to use transform-style attribute.
img { /* Chrome, Safari, Opera */ -webkit-transform: rotate(30deg); -webkit-transform-style: preserve-3d; /* Firefox */ -moz-transform: rotate(30deg); -moz-transform-style: preserve-3d; /* IE 9 */ -ms-transform: rotate(30deg); -ms-transform-style: preserve-3d; transform: rotate(30deg); transform-style: preserve-3d; }Test to see‹/›
The following table describes the value of this attribute.
Value | Description |
---|---|
flat | The child elements of the element are flattened, that is, located in the plane of the element itself. This is the default value. |
preserve-3d | The child elements of the element should be placed in3in D space. |
initial | Set this attribute to its default value. |
inherit | If specified, the associated elements adopt the parent element's transform-The value of style attributes. |
transform-Browser compatibility of style attributes, the numbers in the table below represent the minimum version number of browsers that support this attribute; all mainstream browsers support this attribute.
|
Please refer to the following tutorial:CSS3 2D transformation,CSS3 3D transformation
Related attributes:backface-visibility,perspective,perspective-origin,transform,transform-origin.