-
Notifications
You must be signed in to change notification settings - Fork 0
/
导航页面练习v2.html
93 lines (86 loc) · 1.54 KB
/
导航页面练习v2.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>导航栏练习v2</title>
<style type="text/css">
*{
margin: 0;
padding: 0;
}
.main{
width: 572px;
margin: 20px;
height: 300px;
border: solid 1px #999;
font: 14px "微软雅黑";
position: relative;
}
ul{
list-style-type: none;
}
input{
opacity: 0;
position: absolute;
}
input[type=radio]:checked{
background-color: white;
}
li{
float: left;
}
label{
display: block;
width:190px;
height:30px;
background-color: #f1f1f1;
line-height: 30px;
text-align: center;
border:solid 1px #cecece;
border-top: none;
border-left: none;
}
input:checked + label{
background-color: white;
border-bottom-style: none;
}
.content{
display: none;
text-align: left;
padding: 20px;
position: absolute;
left: 20px;
right: 20px;
}
input:checked ~ .content{
display: block;
}
li:last-child > label{
border-right: none;
}
</style>
</head>
<body>
<div class="main">
<div class="nav">
<ul>
<li>
<input type="radio" name="tab" id="course" checked="checked">
<label for="course">课程</label>
<div class="content">课程内容</div>
</li>
<li>
<input type="radio" name="tab" id="plan">
<label for="plan">学习计划</label>
<div class="content">学习计划内容</div>
</li>
<li>
<input type="radio" name="tab" id="skill">
<label for="skill">技能图谱</label>
<div class="content">技能图谱内容</div>
</li>
</ul>
</div>
</div>
</body>
</html>