-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path标签页.html
104 lines (92 loc) · 2.16 KB
/
标签页.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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>027-标签页.html</title>
<style>
* {
margin: 0;
padding: 0;
}
.tab-page {
width: 300px;
}
.tab-page nav {
display: flex;
border: 1px solid #3c9;
height: 40px;
line-height: 40px;
text-align: center;
}
.tab-page nav p {
position: relative;
flex: 1;
background-color: #3c9;
color: #fff;
}
.tab-page nav p+p {
border-left: 1px solid #fff;
}
.tab-page nav input {
display: none;
}
.tab-page nav label {
display: block;
width: 100%;
height: 100%;
cursor: pointer;
}
.tab-page ul {
overflow: hidden;
scroll-behavior: smooth;
border: 1px solid #3c9;
border-top: none;
height: 300px;
}
.tab-page ul li {
display: flex;
position: relative;
justify-content: center;
align-items: center;
height: 100%;
font-size: 20px;
color: #09f;
}
.tab-page ul input {
position: absolute;
width: 0;
height: 0;
opacity: 0;
}
</style>
</head>
<body>
<div class="tab-page">
<nav>
<p>
<label for="tab1">tab1</label>
</p>
<p>
<label for="tab2">tab2</label>
</p>
<p>
<label for="tab3">tab3</label>
</p>
</nav>
<ul>
<li>
<input id="tab1">
<p>内容1</p>
</li>
<li>
<input id="tab2">
<p>内容2</p>
</li>
<li>
<input id="tab3">
<p>内容3</p>
</li>
</ul>
</div>
</body>
</html>