# 3D 导航栏

直接上源码

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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
<style>
* {
margin: 0;
padding: 0;
}

body {
}

.box {
transform-style: preserve-3d;
float: left;
margin-top: 200px;
}

.box:first-child {
margin-left: 100px;
}

div {
width: 100px;
height: 50px;
}

.top {
background-color: blue;
transform: translateZ(25px);
perspective: 100px;
}

.bottom {
margin-top: 0;
background-color: rgb(182, 92, 8);
transform: translateY(-25px) rotateX(-90deg);
}

.top,
.bottom {
}

.box:hover {
transform: rotateX(90deg);
transition: all 1s;
}
</style>
</head>

<body>
<div class="box">
<div class="top">回家</div>
<div class="bottom">回家</div>
</div>
<div class="box">
<div class="top">回家</div>
<div class="bottom">回家</div>
</div>
<div class="box">
<div class="top">回家</div>
<div class="bottom">回家</div>
</div>
</body>
</html>

更新于 阅读次数

请我喝[茶]~( ̄▽ ̄)~*

Xiao Yang Guo 微信支付

微信支付

Xiao Yang Guo 支付宝

支付宝

Xiao Yang Guo 贝宝

贝宝