Skip to content

Commit

Permalink
Update styles.css
Browse files Browse the repository at this point in the history
  • Loading branch information
chinavpns authored Jan 2, 2025
1 parent d63cdd5 commit 534c5ad
Showing 1 changed file with 21 additions and 83 deletions.
104 changes: 21 additions & 83 deletions assets/css/styles.css
Original file line number Diff line number Diff line change
@@ -1,21 +1,15 @@
/* 全局样式重置 */
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}

body {
font-family: Arial, sans-serif;
font-size: 18px;
margin: 0;
padding: 0;
background-color: #ffffff;
color: #333;
}

/* 页眉样式 */
header nav {
background-color: #fafafa;
padding: 15px 0;
padding: 25px 0;
border-bottom: 1px solid #e0e0e0;
position: fixed;
top: 0;
Expand All @@ -30,7 +24,7 @@ header nav ul.nav {
padding: 0;
display: flex;
justify-content: flex-end;
gap: 20px;
gap: 30px;
margin-right: 20px;
}

Expand All @@ -47,95 +41,39 @@ header nav ul.nav li a:hover {
background-color: rgba(0, 0, 0, 0.05);
}

/* 主内容样式 */
main {
max-width: 1048px;
margin: 80px auto 30px; /* 避免被固定页眉遮住 */
padding: 0 20px;
}

/* 仅文章标题居中 */
main h1.article-title {
text-align: center;
margin-top: 30px;
margin-bottom: 15px;
color: #333;
line-height: 1.2;
}

p {
margin-bottom: 20px;
line-height: 1.6;
}

a {
color: #1a73e8;
text-decoration: underline;
}

a:hover {
text-decoration: underline;
}

ul, ol {
margin-bottom: 20px;
padding-left: 40px;
}

code {
background-color: #f5f5f5;
padding: 2px 4px;
border-radius: 4px;
font-family: 'Courier New', Courier, monospace;
}

pre code {
display: block;
margin: 90px auto 30px;
padding: 20px;
overflow-x: auto;
}

blockquote {
border-left: 4px solid #e0e0e0;
padding-left: 20px;
color: #666;
margin: 20px 0;
background-color: #ffffff;
line-height: 1.8;
}

img {
max-width: 100%;
height: auto;
display: block;
margin: 20px 0;
margin: 20px auto;
}

table {
width: 100%;
border-collapse: collapse;
h1 {
text-align: center;
font-size: 2.5em;
margin-bottom: 20px;
}

table th, table td {
border: 1px solid #e0e0e0;
padding: 10px;
text-align: left;
footer {
text-align: center;
margin-top: 20px;
font-size: 14px;
color: #666;
}

/* 页脚样式 */
footer {
border-top: 1px solid rgba(0, 0, 0, 0.2); /* 添加顶部灰色分隔线 */
background-color: #f8f8f8;
color: #333;
padding: 20px 0;
text-align: center; /* 居中文案 */
margin-top: 40px;
font-size: 14px; /* 调整字体大小 */
a {
color: #0969DA;
text-decoration: underline;
}

/* 修复锚点导航遮挡问题 */
:target::before {
content: '';
display: block;
height: 80px; /* 与页眉高度一致 */
margin-top: -80px;
a:hover {
text-decoration: underline;
}

0 comments on commit 534c5ad

Please sign in to comment.