This is an experimental technology
Check the Browser compatibility table carefully before using this in production.

The CSS transform property lets you modify the coordinate space of the CSS visual formatting model. Using it, elements can be translated, rotated, scaled, and skewed.

/* Keyword values */
transform: none;

/* Function values */
transform: matrix(1.0, 2.0, 3.0, 4.0, 5.0, 6.0);
transform: translate(12px, 50%);
transform: translateX(2em);
transform: translateY(3in);
transform: scale(2, 0.5);
transform: scaleX(2);
transform: scaleY(0.5);
transform: rotate(0.5turn);
transform: skew(30deg, 20deg);
transform: skewX(30deg);
transform: skewY(1.07rad);
transform: matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
transform: translate3d(12px, 50%, 3em);
transform: translateZ(2px);
transform: scale3d(2.5, 1.2, 0.3);
transform: scaleZ(0.3);
transform: rotate3d(1, 2.0, 3.0, 10deg);
transform: rotateX(10deg);
transform: rotateY(10deg);
transform: rotateZ(10deg);
transform: perspective(17px);

/* Multiple function values */
transform: translateX(10px) rotate(10deg) translateY(5px);

/* Global values */
transform: inherit;
transform: initial;
transform: unset;

If the property has a value different than none, a stacking context will be created. In that case the object will act as a containing block for position: fixed elements that it contains.

Initial value (en-US)none
Applies totransformable elements
Inherited (en-US)no
Percentagesrefer to the size of bounding box
Computed value (en-US)as specified, but with relative lengths converted into absolute lengths
Animation typea transform
Creates stacking contextyes


The transform property may be specified as either the keyword value none or as one or more <transform-function> values.


One or more of the CSS transform functions to be applied, see below. Composite transforms are effectively applied in order from right to left.
Specifies that no transform should be applied.

Formal syntax

none | (en-US) <transform-list>

<transform-list> = <transform-function> (en-US)+ (en-US)

<transform-function> = <matrix()> | (en-US) <translate()> | (en-US) <translateX()> | (en-US) <translateY()> | (en-US) <scale()> | (en-US) <scaleX()> | (en-US) <scaleY()> | (en-US) <rotate()> | (en-US) <skew()> | (en-US) <skewX()> | (en-US) <skewY()> | (en-US) <matrix3d()> | (en-US) <translate3d()> | (en-US) <translateZ()> | (en-US) <scale3d()> | (en-US) <scaleZ()> | (en-US) <rotate3d()> | (en-US) <rotateX()> | (en-US) <rotateY()> | (en-US) <rotateZ()> | (en-US) <perspective()>

<matrix()> = matrix( <number> (en-US)# (en-US){ (en-US)6} (en-US) )
<translate()> = translate( <length-percentage> , <length-percentage>? (en-US) )
<translateX()> = translateX( <length-percentage> )
<translateY()> = translateY( <length-percentage> )
<scale()> = scale( <number> (en-US) , <number> (en-US)? (en-US) )
<scaleX()> = scaleX( <number> (en-US) )
<scaleY()> = scaleY( <number> (en-US) )
<rotate()> = rotate( [ (en-US) <angle> (en-US) | (en-US) <zero> ] (en-US) )
<skew()> = skew( [ (en-US) <angle> (en-US) | (en-US) <zero> ] (en-US) , [ (en-US) <angle> (en-US) | (en-US) <zero> ] (en-US)? (en-US) )
<skewX()> = skewX( [ (en-US) <angle> (en-US) | (en-US) <zero> ] (en-US) )
<skewY()> = skewY( [ (en-US) <angle> (en-US) | (en-US) <zero> ] (en-US) )
<matrix3d()> = matrix3d( <number> (en-US)# (en-US){ (en-US)16} (en-US) )
<translate3d()> = translate3d( <length-percentage> , <length-percentage> , <length> (en-US) )
<translateZ()> = translateZ( <length> (en-US) )
<scale3d()> = scale3d( <number> (en-US) , <number> (en-US) , <number> (en-US) )
<scaleZ()> = scaleZ( <number> (en-US) )
<rotate3d()> = rotate3d( <number> (en-US) , <number> (en-US) , <number> (en-US) , [ (en-US) <angle> (en-US) | (en-US) <zero> ] (en-US) )
<rotateX()> = rotateX( [ (en-US) <angle> (en-US) | (en-US) <zero> ] (en-US) )
<rotateY()> = rotateY( [ (en-US) <angle> (en-US) | (en-US) <zero> ] (en-US) )
<rotateZ()> = rotateZ( [ (en-US) <angle> (en-US) | (en-US) <zero> ] (en-US) )
<perspective()> = perspective( <length> (en-US) )

<length-percentage> = <length> (en-US) | (en-US) <percentage> (en-US)


See Using CSS transforms.

Live example

HTML content

<p>Transformed element</p>

CSS content

p {
  border: solid red;

  -webkit-transform: translate(100px) rotate(20deg);
  -webkit-transform-origin: 0 -250px;

  transform: translate(100px) rotate(20deg);
  transform-origin: 0 -250px;


Specification Status Comment
CSS Transforms Level 2
The definition of 'transform' in that specification.
Editor's Draft Adds 3D transform functions.
CSS Transforms Level 1
The definition of 'transform' in that specification.
Working Draft Initial definition

Compatibilidade do navegador

We're converting our compatibility data into a machine-readable JSON format. This compatibility table still uses the old format, because we haven't yet converted the data it contains. Find out how you can help! (en-US)

Funionalidade Chrome Edge Firefox (Gecko) Internet Explorer Opera Safari
Suporte básico (Yes) -webkit (en-US)
(Yes)-webkit (en-US)
3.5 (1.9.1)-moz (en-US)[1]
16.0 (16.0)[2]
9.0-ms (en-US)[3]
10.5-o (en-US)
15.0-webkit (en-US)
3.1-webkit (en-US)
Suporte 3D 12.0-webkit (en-US)
(Yes) 10.0-moz (en-US)
16.0 (16.0)
10.0 15.0-webkit (en-US)

4.0-webkit (en-US)

Funcionalidade Android Chrome for Android Edge Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile
Suporte básico 2.1-webkit (en-US)[4] (Yes)-webkit (en-US) (Yes)-webkit (en-US)
(Yes) (Yes)
11.0-webkit (en-US)[5]
11.5-webkit (en-US) 3.2 (Yes)-webkit (en-US)
Suporte 3D 3.0-webkit (en-US) (Yes)-webkit (en-US) (Yes) (Yes) (Yes) 22-webkit (en-US) 3.2 (Yes)-webkit (en-US)

[1] Gecko 14.0 removed the experimental support for skew(), but it was reintroduced in Gecko 15.0 for compatibility reasons. As it is non-standard and will likely be removed in the future, do not use it.

[2] Before Firefox 16, the translation values of matrix() and matrix3d() could be <length> (en-US), in addition to the standard <number> (en-US).

In addition to the unprefixed support, Gecko 44.0 (Firefox 44.0 / Thunderbird 44.0 / SeaMonkey 2.41) added support for a -webkit prefixed version of the property for web compatibility reasons behind the preference layout.css.prefixes.webkit, defaulting to false. Since Gecko 49.0 (Firefox 49.0 / Thunderbird 49.0 / SeaMonkey 2.46) the preference defaults to true.

[3] Internet Explorer 5.5 or later supports a proprietary Matrix Filter which can be used to achieve a similar effect.

Internet Explorer 9.0 or earlier has no support for 3D transforms. Mixing 3D and 2D transform functions, such as -ms-transform:rotate(10deg) translateZ(0);, will prevent the entire property from being applied.

Internet Explorer does not support the global values initial and unset.

[4] Android 2.3 has a bug where input forms will "jump" when typing, if any container element has a -webkit-transform.

[5] Internet Explorer 11.0 supports the -webkit (en-US) prefixed variant as an alias for the default one.

Consultar também