-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.html
87 lines (85 loc) · 1.71 KB
/
test.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
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
75
76
77
78
79
80
81
82
83
84
85
86
87
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
</head>
<body>
<div class="top">
<label for="c1">div-1</label>
<label for="c2">div-2</label>
<label for="c3">div-3</label>
</div>
<input type="radio" name="page" id="c1" checked>
<div id="div-1" class="page">
<h1>第一页</h1>
</div>
<input type="radio" name="page" id="c2">
<div id="div-2" class="page">
<h1>第二页</h1>
</div>
<input type="radio" name="page" id="c3">
<div id="div-3" class="page">
<h1>第三页</h1>
</div>
</body>
<style>
* {
margin: 0;
padding: 0
}
html,body {
height: 100%;
height: 100%;
background: #a3ceff;
overflow: hidden;
}
.top {
width: 100%;
height: 40px;
line-height: 40px;
background: rgba(0, 0, 0, .6);
position: fixed;
z-index: 9;
}
.top label {
display: inline-block;
width: 30%;
color: #fff;
text-align: center;
cursor: pointer;
}
.top label:hover {
background: rgba(0, 0, 0, .4);
}
input {
display: none;
}
h1 {
color: #fff;
padding-top: 20%;
}
.page {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
min-height: 100%;
background: #3C98FF;
text-align: center;
transform: translateY(-100%);
transition: .6s;
}
input[type=radio]:checked + .page {
transform: translateY(0);
animation: fromBtm .4s;
}
@keyframes fromBtm {
from { transform: translateY(100%); }
to { }
}
</style>
</html>