Course Technology Cengage Learning New Perspectives on HTML5 and CSS3, 8th Edition
Tutorial 4

2D Transformations

To transform an object in two dimensions, apply the following transform style:

transform: effect(params);

where effect is a transformation function and params are parameters used by that function. All transformations are down from the horizontal and vertical center of the object. To change the location of the transformation apply the transform-origin style:

transform-origin: horizontal vertical;

where horizontal vertical is location from where the transformation originates.

Use the web form below to generate the CSS code to apply a transformation to the preview image and to change the location of the transformation.

2D Single Transformations

-100px 100px
-100px 100px
-100px 100px
-100px 100px
-2.0 2.0
2.0 2.0
-2.0 2.0
-2.0 2.0
-360deg 360deg
-360deg 360deg
-360deg 360deg
-360deg 360deg
-360deg 360deg

0% 100%
0% 100%
none;
initial;