The transform property

The transform property specifies element transformations, such as rotation, scaling, skew, translation and others. The corresponding transformations are written separated by a space:

cssselector {
  transform: rotate(30deg) scale(3);
}

Example

In this example, the block is rotated 30 degrees clockwise:

html<div id="elem">lorem ipsum</div>
css#elem {
  transform: rotate(30deg);
  border: 1px solid black;
  width: 100px;
  height: 50px;
}

Результат:

Example

In this example, in addition to the rotation, a skew has also been added:

html<div id="elem">lorem ipsum</div>
css#elem {
  transform: rotate(30deg) skew(20deg);
  border: 1px solid black;
  width: 100px;
  height: 50px;
}

Результат:

Example

In this example, in addition to rotation and skew, scaling has been added:

html<div id="elem">lorem ipsum</div>
css#elem {
  transform: rotate(30deg) skew(20deg) scale(2, 3);
  border: 1px solid black;
  width: 100px;
  height: 50px;
}

Результат: