-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCSS_3D_Transforms.html
More file actions
74 lines (73 loc) · 2.08 KB
/
CSS_3D_Transforms.html
File metadata and controls
74 lines (73 loc) · 2.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>CSS 3D Transforms</title>
<style>
*{
margin: 0;
padding: 0;
box-sizing: border-box;
}
body{
width: 100%;
height: 100%;
}
.container{
background-color: antiquewhite;
padding: 5rem;
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 1rem;
}
.item{
padding: 2rem;
height: 150px;
width: 150px;
background-color: bisque;
border: 2px solid black;
}
#rotatex:hover{
transform: rotateX(45deg);
}
#rotatey:hover{
transform: rotateY(45deg);
}
#rotatez:hover{
transform: rotateZ(45deg);
}
#translatex:hover{
transform: translatex(100px);
}
#translatey:hover{
transform: translatey(100px);
}
#translatez:hover{
transform: perspective(300px) translatez(100px);
}
#scalex:hover{
transform: scalex(1.5);
}
#scaley:hover{
transform: scaley(1.5);
}
#scalez:hover{
transform: perspective(300px) scalez(5) rotateY(30deg);
}
</style>
</head>
<body>
<div class="container">
<div class="item " id="rotatex" >RotateX</div>
<div class="item" id="rotatey" >RotateY</div>
<div class="item" id="rotatez" >RotateZ</div>
<div class="item" id="translatex" >TranslateX</div>
<div class="item" id="translatey" >TranslateY</div>
<div class="item" id="translatez" >TranslateZ</div>
<div class="item" id="scalex" >ScaleX</div>
<div class="item" id="scaley" >ScaleY</div>
<div class="item" id="scalez" >ScaleZ</div>
</div>
</body>
</html>