From 534c5adf92d7614734d5d1e4ccbda5984f3ef923 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A7=91=E5=AD=A6=E4=B8=8A=E7=BD=91=E6=95=99=E7=A8=8B?= Date: Thu, 2 Jan 2025 20:20:01 +0800 Subject: [PATCH] Update styles.css --- assets/css/styles.css | 104 +++++++++--------------------------------- 1 file changed, 21 insertions(+), 83 deletions(-) diff --git a/assets/css/styles.css b/assets/css/styles.css index d50edf3..089aba8 100644 --- a/assets/css/styles.css +++ b/assets/css/styles.css @@ -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; @@ -30,7 +24,7 @@ header nav ul.nav { padding: 0; display: flex; justify-content: flex-end; - gap: 20px; + gap: 30px; margin-right: 20px; } @@ -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; }