1div {
2 width: 80px;
3 height: 80px;
4 background-color: skyblue;
5}
6
7.rotated {
8 transform: rotate(45deg); /* Equal to rotateZ(45deg) */
9 background-color: pink;
10}
11
1div {
2 position: absolute;
3 left: 40px;
4 top: 40px;
5 width: 100px;
6 height: 100px;
7 background-color: lightgray;
8}
9
10.rotate {
11 background-color: transparent;
12 outline: 2px dashed;
13 transform: rotate(45deg);
14}
15
16.rotate-translate {
17 background-color: pink;
18 transform: rotate(45deg) translateX(180px);
19}
20
21.translate-rotate {
22 background-color: gold;
23 transform: translateX(180px) rotate(45deg);
24}
25
1<!DOCTYPE html>
2<html>
3<head>
4<style>
5div.a {
6 width: 150px;
7 height: 80px;
8 background-color: yellow;
9 -ms-transform: rotate(20deg); /* IE 9 */
10 transform: rotate(20deg);
11}
12
13div.b {
14 width: 150px;
15 height: 80px;
16 background-color: yellow;
17 -ms-transform: skewY(20deg); /* IE 9 */
18 transform: skewY(20deg);
19}
20
21div.c {
22 width: 150px;
23 height: 80px;
24 background-color: yellow;
25 -ms-transform: scaleY(1.5); /* IE 9 */
26 transform: scaleY(1.5);
27}
28</style>
29</head>
30<body>
31
32<h1>The transform Property</h1>
33
34<h2>transform: rotate(20deg):</h2>
35<div class="a">Hello World!</div>
36<br>
37
38<h2>transform: skewY(20deg):</h2>
39<div class="b">Hello World!</div>
40<br>
41
42<h2>transform: scaleY(1.5):</h2>
43<div class="c">Hello World!</div>
44
45</body>
46</html>