-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy path缩放.html
48 lines (47 loc) · 981 Bytes
/
缩放.html
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>scale</title>
<style>
main {
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
width: 300px;
height: 300px;
border: 1px solid #333;
transform-style: preserve-3d;
transform: perspective(900px) rotateY(45deg);
transition: 1s;
}
div {
position: absolute;
left: 50%;
top: 50%;
margin-left: -50px;
margin-top: -50px;
width: 100px;
height: 100px;
}
div:nth-child(1) {
background-color: #e1b12c;
}
div:nth-child(2) {
background-color: #40739e;
transform: translateZ(-100px);
}
main:hover {
transform: perspective(900px) rotateY(45deg) scale3d(2, 2, 8);
}
</style>
</head>
<body>
<main>
<div></div>
<div></div>
</main>
</body>
</html>