-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path前端-第2周第2次-CSS(4)-2022·1·15.css
152 lines (129 loc) · 2.72 KB
/
前端-第2周第2次-CSS(4)-2022·1·15.css
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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
/* 背景相关设置 */
body {
width: 100vw;
height: 100vh;
background-color: black;
background-image: url('https://www.xidian.edu.cn/1a2020sydt/2022112.jpg');
background-repeat: no-repeat;
background-position: top center;
background-size: cover;
background-origin: border-box;
background-attachment: fixed;
min-width: 1200px;
}
/* nav设置 */
nav {
width: 100vw;
height: 100px;
display: flex;
justify-content: center;
align-items: center;
}
/* logo部分 */
.logo {
flex: 1;
}
/* 导航栏具体部分 */
.bar {
flex: 4;
display: flex;
justify-content: center;
align-items: center;
padding: 0px 20px;
position: relative;
}
.bar > li {
flex: 1;
}
.bar > li > a {
text-decoration: none;
color: white;
font-size: 20px;
background-color: rgba(0, 0, 0, 0);
display: flex;
justify-content: center;
align-items: center;
width: auto;
height: 2em;
}
/* 导航栏下拉框部分 */
.select {
position: absolute;
display: flex;
justify-content: center;
align-items: center;
background-color: rgba(255, 255, 255, 75%);
height: 200px;
width: 1040px;
padding: 20px 10px;
}
.left, .right {
flex: 1;
}
.left > ul {
display: flex;
justify-content: left;
align-items: center;
flex-wrap: wrap;
width: 66.7%;
height: 100%;
}
.left > ul > li {
display: flex;
justify-content: left;
align-items: center;
width: 50%;
height: 25%;
}
.left > ul > li > a {
text-decoration: none;
color: #666;
line-height: 3em;
text-align: left;
display: block;
}
/* 鼠标移动响应 */
.select {
display: none;
}
.bar > li:hover .select {
display: flex;
}
.bar > li:hover {
background-color: rgb(186, 0, 0);
}
.left > ul > li > a:hover {
color: rgb(186, 0, 0);
}
/* 其他资源部分 */
.right-arrow {
display: inline-block;
position: relative;
width: 9px;
height: 9px;
margin-right: 5px;
}
.right-arrow::after {
display: inline-block;
content: " ";
height: 4.5px;
width: 4.5px;
border-width: 2px 2px 0 0;
border-color: #666;
border-style: solid;
transform: matrix(0.71, 0.71, -0.71, 0.71, 0, 0);
position: absolute;
top: 50%;
right: 3px;
margin-top: -4.5px;
}
.clearfix::before, .clearfix::after{
content: '';
display: table;
clear: both;
/* 以下代码为了解决 IE 浏览器的兼容问题 */
height: 0;
overflow: hidden;
/* 以下代码为了去隐藏content中的内容 */
visibility: hidden;
}