-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdropdown.css
More file actions
50 lines (43 loc) · 1.14 KB
/
dropdown.css
File metadata and controls
50 lines (43 loc) · 1.14 KB
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
/* 下拉菜单 */
/* 下拉菜单按钮 */
.dropbtn {
background-color: lightgreen;
color: white;
padding: 16px;
font-size: 16px;
border: none;
cursor: pointer; /* 鼠标:手型 */
}
/* 下拉菜单(行内块) */
.dropdown {
position: absolute; /* 绝对定位 */
top: 30px;
right: 5%;
display: inline-block;
}
/* 下拉菜单目录 */
.dropdown-content {
display: none;
position: absolute;
background-color: #f9f9f9;
min-width: 160px; /* 段落最小宽度 */
box-shadow: 0px 8px 16px 0px rbga(0,0,0,0.2); /* rgba:前三个为 rgb 值,第四个为透明度)*/
}
/* 下拉菜单目录中的链接格式 */
.dropdown-content a {
color: black;
padding: 12px 16px;
text-decoration: none;
display: block;
}
.dropdown-content a:hover {
background-color: #f1f1f1;
}
/* 当鼠标放在下拉菜单块上时,触发下拉菜单 */
.dropdown:hover .dropdown-content {
display: block;
}
/* 当鼠标放在下拉菜单块上时,改变块的颜色 */
.dropdown:hover .dropbtn {
background-color: darkseagreen;
}