Each feature in detail MDN The backface-visibility CSS property sets whether the back face of an element is visible when turned towards the user.
Live preview Example from MDN
backface-visibility: visible; backface-visibility: hidden;
#default-example {
background : linear-gradient ( skyblue , khaki );
}
#example-element {
width : 100 px ;
height : 100 px ;
perspective : 550 px ;
perspective-origin : 220 % 220 % ;
transform-style : preserve-3d ;
}
.face {
display : flex ;
align-items : center ;
justify-content : center ;
width : 100 % ;
height : 100 % ;
position : absolute ;
backface-visibility : inherit ;
background : rgb ( 0 0 0 / 0.4 );
font-size : 60 px ;
color : white ;
}
.front {
transform : translateZ ( 50 px );
}
.back {
background : rgb ( 230 0 0 );
color : white ;
transform : rotateY ( 180 deg ) translateZ ( 50 px );
}
.right {
background : rgb ( 0 0 0 / 0.6 );
transform : rotateY ( 90 deg ) translateZ ( 50 px );
}
.bottom {
background : rgb ( 0 0 0 / 0.6 );
transform : rotateX ( -90 deg ) translateZ ( 50 px );
} < section class = "default-example" id = "default-example" >
< div id = "example-element" >
< div class = "face front" >1</ div >
< div class = "face back" >2</ div >
< div class = "face right" >3</ div >
< div class = "face bottom" >6</ div >
</ div >
</ section > Syntax visible | hidden Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.
Definition Initial visible Applies to transformable elements Inherited no Percentages N/A Computed value specified keyword Canonical order per grammar Animation type discrete Browser support First browser version supporting backface-visibility Chrome 36 Edge 12 Firefox 16 Safari 15.4 Chrome Android 36 Safari iOS 15.4
First version with support, from MDN browser-compat-data.
Specification ↗ MDN reference ↗
MDN The perspective CSS property determines the distance between the z=0 plane and the user in order to give a 3D-positioned element some perspective.
Live preview Example from MDN
perspective: none; perspective: 800px; perspective: 23rem; perspective: 5.5cm;
#default-example {
background : linear-gradient ( skyblue , khaki );
perspective : 800 px ;
perspective-origin : 150 % 150 % ;
}
#example-element {
width : 100 px ;
height : 100 px ;
perspective : 550 px ;
transform-style : preserve-3d ;
}
.face {
display : flex ;
align-items : center ;
justify-content : center ;
width : 100 % ;
height : 100 % ;
position : absolute ;
backface-visibility : inherit ;
font-size : 60 px ;
color : white ;
}
.front {
background : rgb ( 90 90 90 / 0.7 );
transform : translateZ ( 50 px );
}
.back {
background : rgb ( 0 210 0 / 0.7 );
transform : rotateY ( 180 deg ) translateZ ( 50 px );
}
.right {
background : rgb ( 210 0 0 / 0.7 );
transform : rotateY ( 90 deg ) translateZ ( 50 px );
}
.left {
background : rgb ( 0 0 210 / 0.7 );
transform : rotateY ( -90 deg ) translateZ ( 50 px );
}
.top {
background : rgb ( 210 210 0 / 0.7 );
transform : rotateX ( 90 deg ) translateZ ( 50 px );
}
.bottom {
background : rgb ( 210 0 210 / 0.7 );
transform : rotateX ( -90 deg ) translateZ ( 50 px );
} < section class = "default-example" id = "default-example" >
< div class = "transition-all" id = "example-element" >
< div class = "face front" >1</ div >
< div class = "face back" >2</ div >
< div class = "face right" >3</ div >
< div class = "face left" >4</ div >
< div class = "face top" >5</ div >
< div class = "face bottom" >6</ div >
</ div >
</ section > Syntax none | <length [0,∞]> Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.
Definition Initial none Applies to transformable elements Inherited no Percentages N/A Computed value the keyword none or an absolute length Canonical order per grammar Animation type by computed value Browser support First browser version supporting perspective Chrome 36 Edge 12 Firefox 16 Safari 9 Chrome Android 36 Safari iOS 9
First version with support, from MDN browser-compat-data.
Specification ↗ MDN reference ↗
MDN The perspective-origin CSS property determines the position at which the viewer is looking. It is used as the vanishing point by the perspective property.
Live preview Example from MDN
perspective-origin: center; perspective-origin: top; perspective-origin: bottom right; perspective-origin: -170%; perspective-origin: 500% 200%;
#default-example {
background : linear-gradient ( skyblue , khaki );
perspective : 550 px ;
}
#example-element {
width : 100 px ;
height : 100 px ;
transform-style : preserve-3d ;
perspective : 250 px ;
}
.face {
display : flex ;
align-items : center ;
justify-content : center ;
width : 100 % ;
height : 100 % ;
position : absolute ;
backface-visibility : inherit ;
font-size : 60 px ;
color : white ;
}
.front {
background : rgb ( 90 90 90 / 0.7 );
transform : translateZ ( 50 px );
}
.back {
background : rgb ( 0 210 0 / 0.7 );
transform : rotateY ( 180 deg ) translateZ ( 50 px );
}
.right {
background : rgb ( 210 0 0 / 0.7 );
transform : rotateY ( 90 deg ) translateZ ( 50 px );
}
.left {
background : rgb ( 0 0 210 / 0.7 );
transform : rotateY ( -90 deg ) translateZ ( 50 px );
}
.top {
background : rgb ( 210 210 0 / 0.7 );
transform : rotateX ( 90 deg ) translateZ ( 50 px );
}
.bottom {
background : rgb ( 210 0 210 / 0.7 );
transform : rotateX ( -90 deg ) translateZ ( 50 px );
} < section class = "default-example" id = "default-example" >
< div class = "transition-all" id = "example-element" >
< div class = "face front" >1</ div >
< div class = "face back" >2</ div >
< div class = "face right" >3</ div >
< div class = "face left" >4</ div >
< div class = "face top" >5</ div >
< div class = "face bottom" >6</ div >
</ div >
</ section > Syntax <position> Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.
Definition Initial 50% 50% Applies to transformable elements Inherited no Percentages refer to the size of the reference box Computed value see background-position Canonical order per grammar Animation type by computed value Browser support First browser version supporting perspective-origin Chrome 36 Edge 12 Firefox 16 Safari 9 Chrome Android 36 Safari iOS 9
First version with support, from MDN browser-compat-data.
Specification ↗ MDN reference ↗
MDN The rotate CSS property allows you to specify rotation transforms individually and independently of the transform property. This maps better to typical user interface usage, and saves having to remember the exact order of transform functions to specify in the transform property.
Live preview Example from MDN
rotate: none; rotate: -45deg; rotate: z 45deg; rotate: x 45deg; rotate: y 45deg; rotate: 3 0.5 2 45deg;
#default-example {
background : linear-gradient ( skyblue , khaki );
perspective : 550 px ;
}
#example-element {
width : 100 px ;
height : 100 px ;
transform-style : preserve-3d ;
}
.face {
display : flex ;
align-items : center ;
justify-content : center ;
width : 100 % ;
height : 100 % ;
position : absolute ;
backface-visibility : inherit ;
font-size : 60 px ;
color : white ;
}
.front {
background : rgb ( 90 90 90 / 0.7 );
transform : translateZ ( 50 px );
}
.back {
background : rgb ( 0 210 0 / 0.7 );
transform : rotateY ( 180 deg ) translateZ ( 50 px );
}
.right {
background : rgb ( 210 0 0 / 0.7 );
transform : rotateY ( 90 deg ) translateZ ( 50 px );
}
.left {
background : rgb ( 0 0 210 / 0.7 );
transform : rotateY ( -90 deg ) translateZ ( 50 px );
}
.top {
background : rgb ( 210 210 0 / 0.7 );
transform : rotateX ( 90 deg ) translateZ ( 50 px );
}
.bottom {
background : rgb ( 210 0 210 / 0.7 );
transform : rotateX ( -90 deg ) translateZ ( 50 px );
} < section class = "default-example" id = "default-example" >
< div class = "transition-all" id = "example-element" >
< div class = "face front" >1</ div >
< div class = "face back" >2</ div >
< div class = "face right" >3</ div >
< div class = "face left" >4</ div >
< div class = "face top" >5</ div >
< div class = "face bottom" >6</ div >
</ div >
</ section > Syntax none | <angle> | [ x | y | z | <number>{3} ] && <angle> Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.
Definition Initial none Applies to transformable elements Inherited no Percentages n/a Computed value the keyword none, or an <angle> with an axis consisting of a list of three <number>s Canonical order per grammar Animation type as SLERP, but see below for none Browser support First browser version supporting rotate Chrome 104 Edge 104 Firefox 72 Safari 14.1 Chrome Android 104 Safari iOS 14.5
First version with support, from MDN browser-compat-data.
Specification ↗ MDN reference ↗
MDN The scale CSS property allows you to specify scale transforms individually and independently of the transform property. This maps better to typical user interface usage, and saves having to remember the exact order of transform functions to specify in the transform value.
Live preview Example from MDN
scale: none; scale: 1.5; scale: 1.7 50%; scale: 1 -1; scale: 1.2 1.2 2;
#default-example {
background : linear-gradient ( skyblue , khaki );
perspective : 800 px ;
perspective-origin : 150 % 150 % ;
}
#example-element {
width : 100 px ;
height : 100 px ;
perspective : 550 px ;
transform-style : preserve-3d ;
}
.face {
display : flex ;
align-items : center ;
justify-content : center ;
width : 100 % ;
height : 100 % ;
position : absolute ;
backface-visibility : inherit ;
font-size : 60 px ;
color : white ;
}
.front {
background : rgb ( 90 90 90 / 0.7 );
transform : translateZ ( 50 px );
}
.back {
background : rgb ( 0 210 0 / 0.7 );
transform : rotateY ( 180 deg ) translateZ ( 50 px );
}
.right {
background : rgb ( 210 0 0 / 0.7 );
transform : rotateY ( 90 deg ) translateZ ( 50 px );
}
.left {
background : rgb ( 0 0 210 / 0.7 );
transform : rotateY ( -90 deg ) translateZ ( 50 px );
}
.top {
background : rgb ( 210 210 0 / 0.7 );
transform : rotateX ( 90 deg ) translateZ ( 50 px );
}
.bottom {
background : rgb ( 210 0 210 / 0.7 );
transform : rotateX ( -90 deg ) translateZ ( 50 px );
} < section class = "default-example" id = "default-example" >
< div class = "transition-all" id = "example-element" >
< div class = "face front" >1</ div >
< div class = "face back" >2</ div >
< div class = "face right" >3</ div >
< div class = "face left" >4</ div >
< div class = "face top" >5</ div >
< div class = "face bottom" >6</ div >
</ div >
</ section > Syntax none | [ <number> | <percentage> ]{1,3} Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.
Definition Initial none Applies to transformable elements Inherited no Percentages n/a Computed value the keyword none, or a list of 3 <number>s Canonical order per grammar Animation type by computed value, but see below for none Browser support First browser version supporting scale Chrome 104 Edge 104 Firefox 72 Safari 14.1 Chrome Android 104 Safari iOS 14.5
First version with support, from MDN browser-compat-data.
Specification ↗ MDN reference ↗
MDN The transform CSS property lets you rotate, scale, skew, or translate an element. It modifies the coordinate space of the CSS visual formatting model .
Live preview Example from MDN
transform: matrix(1, 2, 3, 4, 5, 6); transform: translate(120px, 50%); transform: scale(2, 0.5); transform: rotate(0.5turn); transform: skew(30deg, 20deg); transform: scale(0.5) translate(-100%, -100%);
Syntax none | <transform-list> Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.
Definition Initial none Applies to transformable elements Inherited no Percentages refer to the size of reference box Computed value as specified, but with lengths made absolute Canonical order per grammar Animation type transform list, see interpolation rules Browser support First browser version supporting transform Chrome 36 Edge 12 Firefox 16 Safari 9 Chrome Android 36 Safari iOS 9
First version with support, from MDN browser-compat-data.
Specification ↗ MDN reference ↗
MDN The transform-box CSS property defines the layout box to which the transform , individual transform properties translate , scale , and rotate , and transform-origin properties relate.
Live preview Example from MDN
Syntax content-box | border-box | fill-box | stroke-box | view-box Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.
Definition Initial view-box Applies to transformable elements Inherited no Percentages N/A Computed value specified keyword Canonical order per grammar Animation type discrete Browser support First browser version supporting transform-box Chrome 64 Edge 79 Firefox 55 Safari 11 Chrome Android 64 Safari iOS 11
First version with support, from MDN browser-compat-data.
Specification ↗ MDN reference ↗
MDN The transform-origin CSS property sets the origin for an element's transformations.
Live preview Example from MDN
transform-origin: center; transform-origin: top left; transform-origin: 50px 50px; /* 3D rotation with z-axis origin */
transform-origin: bottom right 60px;
CSS HTML JS
Edit Reset Copy
Syntax [ left | center | right | top | bottom | <length-percentage> ] | [ left | center | right | <length-percentage> ] [ top | center | bottom | <length-percentage> ] <length>? | [ [ center | left | right ] && [ center | top | bottom ] ] <length>? Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.
Definition Initial 50% 50% Applies to transformable elements Inherited no Percentages refer to the size of reference box Computed value see background-position Canonical order per grammar Animation type by computed value Browser support First browser version supporting transform-origin Chrome 36 Edge 12 Firefox 16 Safari 9 Chrome Android 36 Safari iOS 9
First version with support, from MDN browser-compat-data.
Specification ↗ MDN reference ↗
MDN The transform-style CSS property sets whether children of an element are positioned in the 3D space or are flattened in the plane of the element.
Live preview Example from MDN
transform-style: flat; transform-style: preserve-3d;
Syntax flat | preserve-3d Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.
Definition Initial flat Applies to transformable elements Inherited no Percentages N/A Computed value specified keyword Canonical order per grammar Animation type discrete Browser support First browser version supporting transform-style Chrome 36 Edge 12 Firefox 16 Safari 9 Chrome Android 36 Safari iOS 9
First version with support, from MDN browser-compat-data.
Specification ↗ MDN reference ↗
MDN The translate CSS property allows you to specify translation transforms individually and independently of the transform property. This maps better to typical user interface usage, and saves having to remember the exact order of transform functions to specify in the transform value.
Live preview Example from MDN
translate: none; translate: 40px; translate: 50% -40%; translate: 20px 4rem; translate: 20px 4rem 150px;
#default-example {
background : linear-gradient ( skyblue , khaki );
perspective : 800 px ;
perspective-origin : 150 % 150 % ;
}
#example-element {
width : 100 px ;
height : 100 px ;
perspective : 550 px ;
transform-style : preserve-3d ;
}
.face {
display : flex ;
align-items : center ;
justify-content : center ;
width : 100 % ;
height : 100 % ;
position : absolute ;
backface-visibility : inherit ;
font-size : 60 px ;
color : white ;
}
.front {
background : rgb ( 90 90 90 / 0.7 );
transform : translateZ ( 50 px );
}
.back {
background : rgb ( 0 210 0 / 0.7 );
transform : rotateY ( 180 deg ) translateZ ( 50 px );
}
.right {
background : rgb ( 210 0 0 / 0.7 );
transform : rotateY ( 90 deg ) translateZ ( 50 px );
}
.left {
background : rgb ( 0 0 210 / 0.7 );
transform : rotateY ( -90 deg ) translateZ ( 50 px );
}
.top {
background : rgb ( 210 210 0 / 0.7 );
transform : rotateX ( 90 deg ) translateZ ( 50 px );
}
.bottom {
background : rgb ( 210 0 210 / 0.7 );
transform : rotateX ( -90 deg ) translateZ ( 50 px );
} < section class = "default-example" id = "default-example" >
< div class = "transition-all" id = "example-element" >
< div class = "face front" >1</ div >
< div class = "face back" >2</ div >
< div class = "face right" >3</ div >
< div class = "face left" >4</ div >
< div class = "face top" >5</ div >
< div class = "face bottom" >6</ div >
</ div >
</ section > Syntax none | <length-percentage> [ <length-percentage> <length>? ]? Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.
Definition Initial none Applies to transformable elements Inherited no Percentages relative to the width of the reference box (for the first value) or the height (for the second value) Computed value the keyword none or a pair of computed <length-percentage> values and an absolute length Canonical order per grammar Animation type by computed value, but see below for none Browser support First browser version supporting translate Chrome 104 Edge 104 Firefox 72 Safari 14.1 Chrome Android 104 Safari iOS 14.5
First version with support, from MDN browser-compat-data.
Specification ↗ MDN reference ↗
MDN The matrix() CSS function defines a homogeneous 2D transformation matrix. Its result is a <transform-function> data type.
Live preview Example from MDN
transform: matrix(1.2, 0.2, -1, 0.9, 0, 20); transform: matrix(0.4, 0, 0.5, 1.2, 60, 10); transform: matrix(0, 1, 1, 0, 0, 0); transform: matrix(0.1, 1, -0.3, 1, 0, 0);
< section id = "default-example" >
< img
class = "transition-all"
id = "example-element"
src = "https://developer.mozilla.org/shared-assets/images/examples/firefox-logo.svg"
width = "200" />
</ section > Syntax /* for transform */
matrix( <number>#{6} ) Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.
Browser support First browser version supporting matrix() Chrome 1 Edge 12 Firefox 3.5 Safari 3.1 Chrome Android 18 Safari iOS 3.2
First version with support, from MDN browser-compat-data.
Defined for transform
This feature only appears in the context of these properties, functions or types.
Specification ↗ MDN reference ↗
MDN The matrix3d() CSS function defines a 3D transformation as a 4x4 homogeneous matrix. Its result is a <transform-function> data type.
Live preview Example from MDN
transform: matrix3d(
-0.6,
1.34788,
0,
0,
-2.34788,
-0.6,
0,
0,
0,
0,
1,
0,
0,
0,
10,
1
); transform: matrix3d(
0.5,
0,
-0.866025,
0,
0.595877,
1.2,
-1.03209,
0,
0.866025,
0,
0.5,
0,
25.9808,
0,
15,
1
);
< section id = "default-example" >
< img
class = "transition-all"
id = "example-element"
src = "https://developer.mozilla.org/shared-assets/images/examples/firefox-logo.svg"
width = "200" />
</ section > Syntax matrix3d( <number>#{16} ) Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.
Browser support First browser version supporting matrix3d() Chrome 12 Edge 12 Firefox 10 Safari 4 Chrome Android 18 Safari iOS 3.2
First version with support, from MDN browser-compat-data.
Specification ↗ MDN reference ↗
MDN The perspective() CSS function defines a transformation that sets the distance between the user and the z=0 plane, the perspective from which the viewer would be if the 2-dimensional interface were 3-dimensional. Its result is a <transform-function> data type.
Live preview Example from MDN
transform: perspective(0); transform: perspective(none); transform: perspective(800px); transform: perspective(23rem); transform: perspective(6.5cm);
#default-example {
background : linear-gradient ( skyblue , khaki );
perspective : 800 px ;
perspective-origin : 150 % 150 % ;
}
#example-element {
width : 100 px ;
height : 100 px ;
perspective : 550 px ;
transform-style : preserve-3d ;
}
.face {
display : flex ;
align-items : center ;
justify-content : center ;
width : 100 % ;
height : 100 % ;
position : absolute ;
backface-visibility : inherit ;
font-size : 60 px ;
color : white ;
}
.front {
background : rgb ( 90 90 90 / 0.7 );
transform : translateZ ( 50 px );
}
.back {
background : rgb ( 0 210 0 / 0.7 );
transform : rotateY ( 180 deg ) translateZ ( 50 px );
}
.right {
background : rgb ( 210 0 0 / 0.7 );
transform : rotateY ( 90 deg ) translateZ ( 50 px );
}
.left {
background : rgb ( 0 0 210 / 0.7 );
transform : rotateY ( -90 deg ) translateZ ( 50 px );
}
.top {
background : rgb ( 210 210 0 / 0.7 );
transform : rotateX ( 90 deg ) translateZ ( 50 px );
}
.bottom {
background : rgb ( 210 0 210 / 0.7 );
transform : rotateX ( -90 deg ) translateZ ( 50 px );
} < section class = "default-example" id = "default-example" >
< div class = "transition-all" id = "example-element" >
< div class = "face front" >1</ div >
< div class = "face back" >2</ div >
< div class = "face right" >3</ div >
< div class = "face left" >4</ div >
< div class = "face top" >5</ div >
< div class = "face bottom" >6</ div >
</ div >
</ section > Syntax perspective( [ <length [0,∞]> | none ] ) Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.
Browser support First browser version supporting perspective() Chrome 12 Edge 12 Firefox 10 Safari 4 Chrome Android 18 Safari iOS 3.2
First version with support, from MDN browser-compat-data.
Specification ↗ MDN reference ↗
MDN The rotate() CSS function defines a transformation that rotates an element around a fixed point on the 2D plane, without deforming it. Its result is a <transform-function> data type.
Live preview Example from MDN
transform: rotate(0); transform: rotate(90deg); transform: rotate(-0.25turn); transform: rotate(3.142rad);
< section id = "default-example" >
< img
class = "transition-all"
id = "example-element"
src = "https://developer.mozilla.org/shared-assets/images/examples/firefox-logo.svg"
width = "200" />
</ section > Syntax /* for transform */
rotate( [ <angle> | <zero> ] ) Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.
Browser support First browser version supporting rotate() Chrome 1 Edge 12 Firefox 3.5 Safari 3.1 Chrome Android 18 Safari iOS 3.2
First version with support, from MDN browser-compat-data.
Defined for transform
This feature only appears in the context of these properties, functions or types.
Specification ↗ MDN reference ↗
MDN The rotate3d() CSS function defines a transformation that rotates an element around a fixed axis in 3D space, without deforming it. Its result is a <transform-function> data type.
Live preview Example from MDN
transform: rotate3d(0, 0, 0, 0); transform: rotate3d(1, 1, 1, 45deg); transform: rotate3d(2, -1, -1, -0.2turn); transform: rotate3d(0, 1, 0.5, 3.142rad);
#default-example {
background : linear-gradient ( skyblue , khaki );
perspective : 550 px ;
}
#example-element {
width : 100 px ;
height : 100 px ;
transform-style : preserve-3d ;
}
.face {
display : flex ;
align-items : center ;
justify-content : center ;
width : 100 % ;
height : 100 % ;
position : absolute ;
backface-visibility : inherit ;
font-size : 60 px ;
color : white ;
}
.front {
background : rgb ( 90 90 90 / 0.7 );
transform : translateZ ( 50 px );
}
.back {
background : rgb ( 0 210 0 / 0.7 );
transform : rotateY ( 180 deg ) translateZ ( 50 px );
}
.right {
background : rgb ( 210 0 0 / 0.7 );
transform : rotateY ( 90 deg ) translateZ ( 50 px );
}
.left {
background : rgb ( 0 0 210 / 0.7 );
transform : rotateY ( -90 deg ) translateZ ( 50 px );
}
.top {
background : rgb ( 210 210 0 / 0.7 );
transform : rotateX ( 90 deg ) translateZ ( 50 px );
}
.bottom {
background : rgb ( 210 0 210 / 0.7 );
transform : rotateX ( -90 deg ) translateZ ( 50 px );
} < section class = "default-example" id = "default-example" >
< div class = "transition-all" id = "example-element" >
< div class = "face front" >1</ div >
< div class = "face back" >2</ div >
< div class = "face right" >3</ div >
< div class = "face left" >4</ div >
< div class = "face top" >5</ div >
< div class = "face bottom" >6</ div >
</ div >
</ section > Syntax rotate3d( <number> , <number> , <number> , [ <angle> | <zero> ] ) Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.
Browser support First browser version supporting rotate3d() Chrome 12 Edge 12 Firefox 10 Safari 4 Chrome Android 18 Safari iOS 3.2
First version with support, from MDN browser-compat-data.
Specification ↗ MDN reference ↗
MDN The rotateX() CSS function defines a transformation that rotates an element around the x-axis (horizontal) without deforming it. Its result is a <transform-function> data type.
Live preview Example from MDN
transform: rotateX(0); transform: rotateX(45deg); transform: rotateX(-0.2turn); transform: rotateX(3.142rad);
< section id = "default-example" >
< img
class = "transition-all"
id = "example-element"
src = "https://developer.mozilla.org/shared-assets/images/examples/firefox-logo.svg"
width = "200" />
</ section > Syntax rotateX( [ <angle> | <zero> ] ) Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.
Browser support First browser version supporting rotateX() Chrome 12 Edge 12 Firefox 10 Safari 4 Chrome Android 18 Safari iOS 3.2
First version with support, from MDN browser-compat-data.
Specification ↗ MDN reference ↗
MDN The rotateY() CSS function defines a transformation that rotates an element around the y-axis (vertical) without deforming it. Its result is a <transform-function> data type.
Live preview Example from MDN
transform: rotateY(0); transform: rotateY(45deg); transform: rotateY(-0.2turn); transform: rotateY(3.142rad);
< section id = "default-example" >
< img
class = "transition-all"
id = "example-element"
src = "https://developer.mozilla.org/shared-assets/images/examples/firefox-logo.svg"
width = "200" />
</ section > Syntax rotateY( [ <angle> | <zero> ] ) Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.
Browser support First browser version supporting rotateY() Chrome 12 Edge 12 Firefox 10 Safari 4 Chrome Android 18 Safari iOS 3.2
First version with support, from MDN browser-compat-data.
Specification ↗ MDN reference ↗
MDN The rotateZ() CSS function defines a transformation that rotates an element around the z-axis without deforming it. Its result is a <transform-function> data type.
Live preview Example from MDN
transform: rotateZ(0); transform: rotateZ(90deg); transform: rotateZ(-0.25turn); transform: rotateZ(3.142rad);
< section id = "default-example" >
< img
class = "transition-all"
id = "example-element"
src = "https://developer.mozilla.org/shared-assets/images/examples/firefox-logo.svg"
width = "200" />
</ section > Syntax rotateZ( [ <angle> | <zero> ] ) Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.
Browser support First browser version supporting rotateZ() Chrome 12 Edge 12 Firefox 10 Safari 4 Chrome Android 18 Safari iOS 3.2
First version with support, from MDN browser-compat-data.
Specification ↗ MDN reference ↗
MDN The scale() CSS function defines a transformation that resizes an element on the 2D plane. Because the amount of scaling is defined by a vector [sx, sy], it can resize the horizontal and vertical dimensions at different scales. Its result is a <transform-function> data type.
Live preview Example from MDN
transform: scale(1); transform: scale(0.7); transform: scale(1.3, 0.4); transform: scale(-0.5, 1);
< section id = "default-example" >
< img
class = "transition-all"
id = "example-element"
src = "https://developer.mozilla.org/shared-assets/images/examples/firefox-logo.svg"
width = "200" />
</ section > Syntax scale( [ <number> | <percentage> ]#{1,2} )
/* for transform */
scale( <number> , <number>? ) Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.
Browser support First browser version supporting scale() Chrome 1 Edge 12 Firefox 3.5 Safari 3.1 Chrome Android 18 Safari iOS 3.2
First version with support, from MDN browser-compat-data.
Defined for transform
This feature only appears in the context of these properties, functions or types.
Specification ↗ MDN reference ↗
MDN The scale3d() CSS function defines a transformation that resizes an element in 3D space. Because the amount of scaling is defined by a vector [sx, sy, sz], it can resize different dimensions at different scales. Its result is a <transform-function> data type.
Live preview Example from MDN
transform: scale3d(1, 1, 1); transform: scale3d(1.3, 1.3, 1.3); transform: scale3d(0.5, 1, 1.7); transform: scale3d(-1.4, 0.4, 0.7);
#default-example {
background : linear-gradient ( skyblue , khaki );
perspective : 800 px ;
perspective-origin : 150 % 150 % ;
}
#example-element {
width : 100 px ;
height : 100 px ;
perspective : 550 px ;
transform-style : preserve-3d ;
}
.face {
display : flex ;
align-items : center ;
justify-content : center ;
width : 100 % ;
height : 100 % ;
position : absolute ;
backface-visibility : inherit ;
font-size : 60 px ;
color : white ;
}
.front {
background : rgb ( 90 90 90 / 0.7 );
transform : translateZ ( 50 px );
}
.back {
background : rgb ( 0 210 0 / 0.7 );
transform : rotateY ( 180 deg ) translateZ ( 50 px );
}
.right {
background : rgb ( 210 0 0 / 0.7 );
transform : rotateY ( 90 deg ) translateZ ( 50 px );
}
.left {
background : rgb ( 0 0 210 / 0.7 );
transform : rotateY ( -90 deg ) translateZ ( 50 px );
}
.top {
background : rgb ( 210 210 0 / 0.7 );
transform : rotateX ( 90 deg ) translateZ ( 50 px );
}
.bottom {
background : rgb ( 210 0 210 / 0.7 );
transform : rotateX ( -90 deg ) translateZ ( 50 px );
} < section class = "default-example" id = "default-example" >
< div class = "transition-all" id = "example-element" >
< div class = "face front" >1</ div >
< div class = "face back" >2</ div >
< div class = "face right" >3</ div >
< div class = "face left" >4</ div >
< div class = "face top" >5</ div >
< div class = "face bottom" >6</ div >
</ div >
</ section > Syntax scale3d( [ <number> | <percentage> ]#{3} ) Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.
Browser support First browser version supporting scale3d() Chrome 12 Edge 12 Firefox 10 Safari 4 Chrome Android 18 Safari iOS 3.2
First version with support, from MDN browser-compat-data.
Specification ↗ MDN reference ↗
MDN The scaleX() CSS function defines a transformation that resizes an element along the x-axis (horizontally). Its result is a <transform-function> data type.
Live preview Example from MDN
transform: scaleX(1); transform: scaleX(0.7); transform: scaleX(1.3); transform: scaleX(-0.5);
< section id = "default-example" >
< img
class = "transition-all"
id = "example-element"
src = "https://developer.mozilla.org/shared-assets/images/examples/firefox-logo.svg"
width = "200" />
</ section > Syntax scaleX( [ <number> | <percentage> ] )
/* for transform */
scaleX( <number> ) Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.
Browser support First browser version supporting scaleX() Chrome 1 Edge 12 Firefox 3.5 Safari 3.1 Chrome Android 18 Safari iOS 3.2
First version with support, from MDN browser-compat-data.
Defined for transform
This feature only appears in the context of these properties, functions or types.
Specification ↗ MDN reference ↗
MDN The scaleY() CSS function defines a transformation that resizes an element along the y-axis (vertically). Its result is a <transform-function> data type.
Live preview Example from MDN
transform: scaleY(1); transform: scaleY(0.7); transform: scaleY(1.3); transform: scaleY(-0.5);
< section id = "default-example" >
< img
class = "transition-all"
id = "example-element"
src = "https://developer.mozilla.org/shared-assets/images/examples/firefox-logo.svg"
width = "200" />
</ section > Syntax scaleY( [ <number> | <percentage> ] )
/* for transform */
scaleY( <number> ) Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.
Browser support First browser version supporting scaleY() Chrome 1 Edge 12 Firefox 3.5 Safari 3.1 Chrome Android 18 Safari iOS 3.2
First version with support, from MDN browser-compat-data.
Defined for transform
This feature only appears in the context of these properties, functions or types.
Specification ↗ MDN reference ↗
MDN The scaleZ() CSS function defines a transformation that resizes an element along the z-axis. Its result is a <transform-function> data type.
Live preview Example from MDN
transform: scaleZ(1); transform: scaleZ(1.4); transform: scaleZ(0.5); transform: scaleZ(-1.4);
#default-example {
background : linear-gradient ( skyblue , khaki );
perspective : 800 px ;
perspective-origin : 150 % 150 % ;
}
#example-element {
width : 100 px ;
height : 100 px ;
perspective : 550 px ;
transform-style : preserve-3d ;
}
.face {
display : flex ;
align-items : center ;
justify-content : center ;
width : 100 % ;
height : 100 % ;
position : absolute ;
backface-visibility : inherit ;
font-size : 60 px ;
color : white ;
}
.front {
background : rgb ( 90 90 90 / 0.7 );
transform : translateZ ( 50 px );
}
.back {
background : rgb ( 0 210 0 / 0.7 );
transform : rotateY ( 180 deg ) translateZ ( 50 px );
}
.right {
background : rgb ( 210 0 0 / 0.7 );
transform : rotateY ( 90 deg ) translateZ ( 50 px );
}
.left {
background : rgb ( 0 0 210 / 0.7 );
transform : rotateY ( -90 deg ) translateZ ( 50 px );
}
.top {
background : rgb ( 210 210 0 / 0.7 );
transform : rotateX ( 90 deg ) translateZ ( 50 px );
}
.bottom {
background : rgb ( 210 0 210 / 0.7 );
transform : rotateX ( -90 deg ) translateZ ( 50 px );
} < section class = "default-example" id = "default-example" >
< div class = "transition-all" id = "example-element" >
< div class = "face front" >1</ div >
< div class = "face back" >2</ div >
< div class = "face right" >3</ div >
< div class = "face left" >4</ div >
< div class = "face top" >5</ div >
< div class = "face bottom" >6</ div >
</ div >
</ section > Syntax scaleZ( [ <number> | <percentage> ] ) Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.
Browser support First browser version supporting scaleZ() Chrome 12 Edge 12 Firefox 10 Safari 4 Chrome Android 18 Safari iOS 3.2
First version with support, from MDN browser-compat-data.
Specification ↗ MDN reference ↗
MDN The skew() CSS function defines a transformation that skews an element on the 2D plane. Its result is a <transform-function> data type.
Live preview Example from MDN
transform: skew(0); transform: skew(15deg, 15deg); transform: skew(-0.06turn, 18deg); transform: skew(0.312rad);
< section id = "default-example" >
< img
class = "transition-all"
id = "example-element"
src = "https://developer.mozilla.org/shared-assets/images/examples/firefox-logo.svg"
width = "200" />
</ section > Syntax /* for transform */
skew( [ <angle> | <zero> ] , [ <angle> | <zero> ]? ) Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.
Browser support First browser version supporting skew() Chrome 1 Edge 12 Firefox 3.5 Safari 3.1 Chrome Android 18 Safari iOS 3.2
First version with support, from MDN browser-compat-data.
Defined for transform
This feature only appears in the context of these properties, functions or types.
Specification ↗ MDN reference ↗
MDN The skewX() CSS function defines a transformation that skews an element in the horizontal direction on the 2D plane. Its result is a <transform-function> data type.
Live preview Example from MDN
transform: skewX(0); transform: skewX(35deg); transform: skewX(-0.06turn); transform: skewX(0.352rad);
< section id = "default-example" >
< img
class = "transition-all"
id = "example-element"
src = "https://developer.mozilla.org/shared-assets/images/examples/firefox-logo.svg"
width = "200" />
</ section > Syntax /* for transform */
skewX( [ <angle> | <zero> ] ) Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.
Browser support First browser version supporting skewX() Chrome 1 Edge 12 Firefox 3.5 Safari 3.1 Chrome Android 18 Safari iOS 3.2
First version with support, from MDN browser-compat-data.
Defined for transform
This feature only appears in the context of these properties, functions or types.
Specification ↗ MDN reference ↗
MDN The skewY() CSS function defines a transformation that skews an element in the vertical direction on the 2D plane. Its result is a <transform-function> data type.
Live preview Example from MDN
transform: skewY(0); transform: skewY(35deg); transform: skewY(-0.06turn); transform: skewY(0.352rad);
< section id = "default-example" >
< img
class = "transition-all"
id = "example-element"
src = "https://developer.mozilla.org/shared-assets/images/examples/firefox-logo.svg"
width = "200" />
</ section > Syntax /* for transform */
skewY( [ <angle> | <zero> ] ) Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.
Browser support First browser version supporting skewY() Chrome 1 Edge 12 Firefox 3.5 Safari 3.1 Chrome Android 18 Safari iOS 3.2
First version with support, from MDN browser-compat-data.
Defined for transform
This feature only appears in the context of these properties, functions or types.
Specification ↗ MDN reference ↗
MDN The translate() CSS function repositions an element in the horizontal and/or vertical directions. Its result is a <transform-function> data type.
Live preview Example from MDN
transform: translate(0); transform: translate(42px, 18px); transform: translate(-2.1rem, -2ex); transform: translate(3ch, 3mm);
#static-element {
opacity : 0.4 ;
position : absolute ;
}
#example-element {
position : absolute ;
} < section id = "default-example" >
< img
class = "transition-all"
id = "static-element"
src = "https://developer.mozilla.org/shared-assets/images/examples/firefox-logo.svg"
width = "200" />
< img
class = "transition-all"
id = "example-element"
src = "https://developer.mozilla.org/shared-assets/images/examples/firefox-logo.svg"
width = "200" />
</ section > Syntax /* for transform */
translate( <length-percentage> , <length-percentage>? ) Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.
Browser support First browser version supporting translate() Chrome 1 Edge 12 Firefox 3.5 Safari 3.1 Chrome Android 18 Safari iOS 3.2
First version with support, from MDN browser-compat-data.
Defined for transform
This feature only appears in the context of these properties, functions or types.
Specification ↗ MDN reference ↗
MDN The translate3d() CSS function repositions an element in 3D space. Its result is a <transform-function> data type.
Live preview Example from MDN
transform: translate3d(0, 0, 0); transform: translate3d(42px, -62px, -135px); transform: translate3d(-2.7rem, 0, 1rem); transform: translate3d(5ch, 0.4in, 5em);
#default-example {
background : linear-gradient ( skyblue , khaki );
perspective : 800 px ;
perspective-origin : 150 % 150 % ;
}
#example-element {
width : 100 px ;
height : 100 px ;
perspective : 550 px ;
transform-style : preserve-3d ;
}
.face {
display : flex ;
align-items : center ;
justify-content : center ;
width : 100 % ;
height : 100 % ;
position : absolute ;
backface-visibility : inherit ;
font-size : 60 px ;
color : white ;
}
.front {
background : rgb ( 90 90 90 / 0.7 );
transform : translateZ ( 50 px );
}
.back {
background : rgb ( 0 210 0 / 0.7 );
transform : rotateY ( 180 deg ) translateZ ( 50 px );
}
.right {
background : rgb ( 210 0 0 / 0.7 );
transform : rotateY ( 90 deg ) translateZ ( 50 px );
}
.left {
background : rgb ( 0 0 210 / 0.7 );
transform : rotateY ( -90 deg ) translateZ ( 50 px );
}
.top {
background : rgb ( 210 210 0 / 0.7 );
transform : rotateX ( 90 deg ) translateZ ( 50 px );
}
.bottom {
background : rgb ( 210 0 210 / 0.7 );
transform : rotateX ( -90 deg ) translateZ ( 50 px );
} < section class = "default-example" id = "default-example" >
< div class = "transition-all" id = "example-element" >
< div class = "face front" >1</ div >
< div class = "face back" >2</ div >
< div class = "face right" >3</ div >
< div class = "face left" >4</ div >
< div class = "face top" >5</ div >
< div class = "face bottom" >6</ div >
</ div >
</ section > Syntax translate3d( <length-percentage> , <length-percentage> , <length> ) Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.
Browser support First browser version supporting translate3d() Chrome 12 Edge 12 Firefox 10 Safari 4 Chrome Android 18 Safari iOS 3.2
First version with support, from MDN browser-compat-data.
Specification ↗ MDN reference ↗
MDN The translateX() CSS function repositions an element horizontally on the 2D plane. Its result is a <transform-function> data type.
Live preview Example from MDN
transform: translateX(0); transform: translateX(42px); transform: translateX(-2.1rem); transform: translateX(3ch);
#static-element {
opacity : 0.4 ;
position : absolute ;
}
#example-element {
position : absolute ;
} < section id = "default-example" >
< img
class = "transition-all"
id = "static-element"
src = "https://developer.mozilla.org/shared-assets/images/examples/firefox-logo.svg"
width = "200" />
< img
class = "transition-all"
id = "example-element"
src = "https://developer.mozilla.org/shared-assets/images/examples/firefox-logo.svg"
width = "200" />
</ section > Syntax /* for transform */
translateX( <length-percentage> ) Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.
Browser support First browser version supporting translateX() Chrome 1 Edge 12 Firefox 3.5 Safari 3.1 Chrome Android 18 Safari iOS 3.2
First version with support, from MDN browser-compat-data.
Defined for transform
This feature only appears in the context of these properties, functions or types.
Specification ↗ MDN reference ↗
MDN The translateY() CSS function repositions an element vertically on the 2D plane. Its result is a <transform-function> data type.
Live preview Example from MDN
transform: translateY(0); transform: translateY(42px); transform: translateY(-2.1rem); transform: translateY(3ch);
#static-element {
opacity : 0.4 ;
position : absolute ;
}
#example-element {
position : absolute ;
} < section id = "default-example" >
< img
class = "transition-all"
id = "static-element"
src = "https://developer.mozilla.org/shared-assets/images/examples/firefox-logo.svg"
width = "200" />
< img
class = "transition-all"
id = "example-element"
src = "https://developer.mozilla.org/shared-assets/images/examples/firefox-logo.svg"
width = "200" />
</ section > Syntax /* for transform */
translateY( <length-percentage> ) Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.
Browser support First browser version supporting translateY() Chrome 1 Edge 12 Firefox 3.5 Safari 3.1 Chrome Android 18 Safari iOS 3.2
First version with support, from MDN browser-compat-data.
Defined for transform
This feature only appears in the context of these properties, functions or types.
Specification ↗ MDN reference ↗
MDN The translateZ() CSS function repositions an element along the z-axis in 3D space, i.e., closer to or farther away from the viewer. Its result is a <transform-function> data type.
Live preview Example from MDN
transform: translateZ(0); transform: translateZ(42px); transform: translateZ(-9.7rem); transform: translateZ(-3ch);
#default-example {
background : linear-gradient ( skyblue , khaki );
perspective : 800 px ;
perspective-origin : 150 % 150 % ;
}
#example-element {
width : 100 px ;
height : 100 px ;
perspective : 550 px ;
transform-style : preserve-3d ;
}
.face {
display : flex ;
align-items : center ;
justify-content : center ;
width : 100 % ;
height : 100 % ;
position : absolute ;
backface-visibility : inherit ;
font-size : 60 px ;
color : white ;
}
.front {
background : rgb ( 90 90 90 / 0.7 );
transform : translateZ ( 50 px );
}
.back {
background : rgb ( 0 210 0 / 0.7 );
transform : rotateY ( 180 deg ) translateZ ( 50 px );
}
.right {
background : rgb ( 210 0 0 / 0.7 );
transform : rotateY ( 90 deg ) translateZ ( 50 px );
}
.left {
background : rgb ( 0 0 210 / 0.7 );
transform : rotateY ( -90 deg ) translateZ ( 50 px );
}
.top {
background : rgb ( 210 210 0 / 0.7 );
transform : rotateX ( 90 deg ) translateZ ( 50 px );
}
.bottom {
background : rgb ( 210 0 210 / 0.7 );
transform : rotateX ( -90 deg ) translateZ ( 50 px );
} < section class = "default-example" id = "default-example" >
< div class = "transition-all" id = "example-element" >
< div class = "face front" >1</ div >
< div class = "face back" >2</ div >
< div class = "face right" >3</ div >
< div class = "face left" >4</ div >
< div class = "face top" >5</ div >
< div class = "face bottom" >6</ div >
</ div >
</ section > Syntax translateZ( <length> ) Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.
Browser support First browser version supporting translateZ() Chrome 12 Edge 12 Firefox 10 Safari 4 Chrome Android 18 Safari iOS 3.2
First version with support, from MDN browser-compat-data.
Specification ↗ MDN reference ↗
Spec The value of the transform property is a list of <transform-function>. The set of allowed transform functions is given below. Wherever <angle> is used in this specification, a <number> that is equal to zero is also allowed, which is treated the same as an angle of zero degrees. A percentage for horizontal translations is relative to the width of the reference box. A percentage for vertical translations is relative to the height of the reference box. A percentage in a scale function is equivalent to a number, and serializes as a number in specified values. For example, scale3d(50%, 100%, 150%) serializes as scale3d(0.5, 1, 1.5).
MDN The <transform-function> CSS data type represents a transformation that affects an element's appearance. Transformation functions can rotate, resize, distort, or move an element in 2D or 3D space. It is used in the transform property.
Live preview Example from MDN
CSS HTML JS
Edit Reset Copy
Syntax <scale3d()> | <scale()> | <scaleX()> | <scaleY()> | <scaleZ()> | <translate3d()> | <translate()> | <translateX()> | <translateY()> | <translateZ()> | <rotate3d()> | <rotate()> | <rotateX()> | <rotateY()> | <rotateZ()> | <skew()> | <skewX()> | <skewY()> | <matrix3d()> | <matrix()> | <perspective()> Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.
Browser support First browser version supporting <transform-function> Chrome 1 Edge 12 Firefox 3.5 Safari 3.1 Chrome Android 18 Safari iOS 3.2
First version with support, from MDN browser-compat-data.
Specification ↗ MDN reference ↗