-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathstyle.css
More file actions
258 lines (221 loc) · 5.03 KB
/
style.css
File metadata and controls
258 lines (221 loc) · 5.03 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
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
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
/* 全局样式 */
body {
font-family: 'Comic Sans MS', cursive, sans-serif; /* 卡通字体 */
line-height: 1.6;
margin: 0;
padding: 0;
background-color: #f5f7fa;
}
/* 导航条样式 */
.navbar {
background-color: #409EFF;
overflow: hidden;
display: flex;
align-items: center;
padding: 15px 30px;
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
justify-content: space-between; /* 让标题和导航项分开 */
}
.nav-title {
color: white;
margin: 0;
font-size: 24px;
}
.nav-item {
color: white;
text-align: center;
padding: 12px 20px;
text-decoration: none;
font-size: 18px;
border-radius: 4px;
transition: all 0.3s ease; /* 添加过渡效果 */
}
.nav-item:hover {
background-color: rgba(255, 255, 255, 0.1);
}
.nav-item.active {
background-color: rgba(255, 255, 255, 0.2);
}
/* 文章概要样式 */
.blog-summary {
background-color: white;
border: 1px solid #dcdfe6;
border-radius: 8px;
padding: 25px;
margin: 20px auto;
max-width: 800px;
cursor: pointer;
transition: all 0.3s ease;
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
display: flex; /* 使用 flex 布局 */
flex-wrap: wrap; /* 允许换行 */
align-items: center; /* 垂直居中对齐 */
}
.blog-summary h2 {
margin-top: 0;
color: #303133;
transition: color 0.3s ease;
}
.blog-summary p {
color: #606266;
}
.blog-summary:hover {
transform: translateY(-5px); /* 鼠标悬停上移动画 */
box-shadow: 0 4px 20px 0 rgba(0, 0, 0, 0.15);
}
.blog-summary:hover h2 {
color: #409EFF;
}
.blog-summary img {
max-width: 30%; /* 限制图片最大宽度 */
height: auto; /* 保持图片比例 */
margin-right: 20px; /* 图片与文字之间的间距 */
border-radius: 4px; /* 图片圆角 */
}
/* 当图片在右侧时,调整间距 */
.blog-summary img.right-image {
margin-right: 0;
margin-left: 20px;
}
/* 文章详情样式 */
#blog-detail {
padding: 20px;
max-width: 800px;
margin: 0 auto;
}
#blog-detail button {
background-color: #409EFF;
color: white;
padding: 12px 24px;
border: none;
border-radius: 4px;
cursor: pointer;
font-size: 16px;
transition: background-color 0.3s ease;
}
#blog-detail button:hover {
background-color: #66b1ff;
}
/* 侧边栏整体样式 */
.sidebar {
background-color: white;
border: 1px solid #dcdfe6;
border-radius: 8px;
padding: 20px;
width: 250px;
height: 80%;
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
transition: all 0.3s ease;
}
.sidebar:hover {
box-shadow: 0 4px 20px 0 rgba(0, 0, 0, 0.15);
}
/* 主容器布局,让侧边栏和文章概要并排 */
.main-container {
display: flex;
gap: 20px;
padding: 20px;
max-width: 1200px;
margin: 0 auto;
}
#blog-summaries {
flex: 1;
}
/* 头像容器样式 */
#avatar-container {
text-align: center; /* 让头像和名字都居中 */
}
.avatar {
width: 150px; /* 可根据需要调整头像大小 */
height: 150px;
border-radius: 50%;
margin-bottom: 10px; /* 头像和名字之间的间距 */
}
/* 个人信息名字样式 */
#personal-info h2 {
text-align: center; /* 确保名字居中 */
margin: 0; /* 去除默认边距 */
}
/* 个人简介样式 */
#personal-info p {
text-align: center; /* 简介也居中显示 */
color: #666; /* 简介文字颜色 */
}
#avatar-container img {
width: 120px;
height: 120px;
border-radius: 50%;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
transition: transform 0.3s ease;
}
#avatar-container img:hover {
transform: scale(1.1);
}
.blog-summary {
display: flex;
align-items: center;
gap: 20px;
}
.text-container {
flex: 1;
}
.left-image {
order: -1; /* 让图片显示在左侧 */
}
.right-image {
order: 1; /* 让图片显示在右侧 */
}
/* 评论区整体样式 */
.distinct-comments-section {
margin-top: 40px;
padding: 20px;
background-color: #f5f5f5;
border-top: 3px solid #007BFF;
border-radius: 4px;
}
/* 评论标题样式 */
.distinct-comments-section h2 {
color: #007BFF;
margin-bottom: 15px;
font-size: 1.5em; /* 增大字体大小 */
text-transform: uppercase; /* 标题字母大写 */
letter-spacing: 2px; /* 增加字母间距 */
border-bottom: 2px solid #007BFF; /* 添加下划线 */
padding-bottom: 10px; /* 下划线与文字的间距 */
}
/* 单条评论样式 */
.comment {
background-color: white;
padding: 15px;
margin-bottom: 10px;
border-radius: 4px;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
/* 在评论区和文章之间添加更大的间距 */
#blog-detail .distinct-comments-section {
margin-top: 60px; /* 增大与文章的间距 */
}
/* 评论表单样式 */
.comments-section form {
margin-top: 20px;
display: flex;
flex-direction: column;
gap: 10px;
}
.comments-section input,
.comments-section textarea {
padding: 10px;
border: 1px solid #ccc;
border-radius: 4px;
}
.comments-section button {
padding: 10px;
background-color: #007BFF;
color: white;
border: none;
border-radius: 4px;
cursor: pointer;
}
.comments-section button:hover {
background-color: #0056b3;
}