CSS3 allows you to format your elements using 3D transforms.
In this chapter you will learn about some of the 3D transform methods:
Click on the elements below, to see the difference between a 2D transform and a 3D transform:
| Property | Browser Support | ||||
|---|---|---|---|---|---|
| transform | |||||
Internet Explorer 10 and Firefox supports 3D transforms.
Chrome and Safari requires the prefix -webkit-.
Opera does not yet support 3D transforms (It supports 2D transforms only).
With the rotateX() method, the element rotates around its X-axis at a given degree.
With the rotateY() method, the element rotates around its Y-axis at a given degree.
The following table lists all the transform properties:
| Property | Description | CSS |
|---|---|---|
| transform | Applies a 2D or 3D transformation to an element | 3 |
| transform-origin | Allows you to change the position on transformed elements | 3 |
| transform-style | Specifies how nested elements are rendered in 3D space | 3 |
| perspective | Specifies the perspective on how 3D elements are viewed | 3 |
| perspective-origin | Specifies the bottom position of 3D elements | 3 |
| backface-visibility | Defines whether or not an element should be visible when not facing the screen | 3 |
| Function | Description |
|---|---|
| matrix3d (n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n) |
Defines a 3D transformation, using a 4x4 matrix of 16 values |
| translate3d(x,y,z) | Defines a 3D translation |
| translateX(x) | Defines a 3D translation, using only the value for the X-axis |
| translateY(y) | Defines a 3D translation, using only the value for the Y-axis |
| translateZ(z) | Defines a 3D translation, using only the value for the Z-axis |
| scale3d(x,y,z) | Defines a 3D scale transformation |
| scaleX(x) | Defines a 3D scale transformation by giving a value for the X-axis |
| scaleY(y) | Defines a 3D scale transformation by giving a value for the Y-axis |
| scaleZ(z) | Defines a 3D scale transformation by giving a value for the Z-axis |
| rotate3d(x,y,z,angle) | Defines a 3D rotation |
| rotateX(angle) | Defines a 3D rotation along the X-axis |
| rotateY(angle) | Defines a 3D rotation along the Y-axis |
| rotateZ(angle) | Defines a 3D rotation along the Z-axis |
| perspective(n) | Defines a perspective view for a 3D transformed element |
The perfect solution for professionals who need to balance work, family, and career building.
More than 10 000 certificates already issued!
The HTML Certificate documents your knowledge of HTML.
The HTML5 Certificate documents your knowledge of advanced HTML5.
The CSS Certificate documents your knowledge of advanced CSS.
The JavaScript Certificate documents your knowledge of JavaScript and HTML DOM.
The jQuery Certificate documents your knowledge of jQuery.
The XML Certificate documents your knowledge of XML, XML DOM and XSLT.
The ASP Certificate documents your knowledge of ASP, SQL, and ADO.
The PHP Certificate documents your knowledge of PHP and SQL (MySQL).
Your message has been sent to W3Schools.