From 5a062eaedad679e224b07198981462208e5129b9 Mon Sep 17 00:00:00 2001 From: yiqiu Date: Fri, 26 Dec 2025 23:06:51 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9B=BE=E7=89=87=E9=AB=98=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- css/index.css | 63 ++++++++++++++++++++++++++++++--------------------- 1 file changed, 37 insertions(+), 26 deletions(-) diff --git a/css/index.css b/css/index.css index d0f0ad6..585dca0 100644 --- a/css/index.css +++ b/css/index.css @@ -1878,14 +1878,12 @@ .honor-subtitle { font-size: 14px; color: rgba(203, 213, 225, 0.8); - margin: 0; + margin: 0 auto; margin-top: 16px; max-width: 800px; - margin-left: auto; - margin-right: auto; line-height: 1.8; - text-align: center; - /* 居中对齐 */ + text-align: center !important; + /* 强制居中 */ } /* 网格布局容器 */ @@ -1899,7 +1897,7 @@ position: relative; z-index: 1; justify-items: center; - /* 网格项居中对齐 */ + /* 网格项水平居中 */ } /* 网格项样式 */ @@ -1910,15 +1908,15 @@ border-radius: 12px; padding: 20px; transition: all 0.3s ease; - overflow: hidden; display: flex; flex-direction: column; align-items: center; - justify-content: center; + /* 内容居中 */ + justify-content: flex-start; width: 100%; - /* 占满网格单元 */ max-width: 220px; - /* 限制最大宽度 */ + min-height: 240px; + /* 确保有足够空间 */ } .honor-grid-item:hover { @@ -1928,17 +1926,20 @@ transform: translateY(-4px); } +/* 图片样式 - 统一高度,宽度自适应 */ .honor-grid-item img { - width: auto; - /* 宽度自适应 */ - max-width: 100%; - /* 不超过容器宽度 */ - height: 180px; - /* 固定高度 */ - object-fit: contain; - /* 保持比例 */ + display: block; + width: auto !important; + /* 宽度自动计算 */ + max-width: 180px; + /* 限制最大宽度 */ + height: 180px !important; + /* 统一高度 */ + object-fit: contain !important; + /* 保持原始比例 */ transition: all 0.3s ease; - margin-bottom: 12px; + margin: 0 auto 12px auto; + /* 水平居中 */ } .honor-grid-item:hover img { @@ -1951,10 +1952,11 @@ color: rgba(203, 213, 225, 0.9); text-align: center; margin: 0; - margin-top: 8px; + padding: 0 5px; line-height: 1.4; font-weight: 500; transition: color 0.3s ease; + width: 100%; } .honor-grid-item:hover .honor-grid-name { @@ -3037,15 +3039,18 @@ html { .honor-grid-item { padding: 16px; max-width: 100%; + min-height: 200px; } .honor-grid-item img { - height: 140px; + width: auto !important; + max-width: 140px; + height: 140px !important; + margin: 0 auto 10px auto; } .honor-grid-name { font-size: 13px; - margin-top: 6px; } /* ===== 新闻区域 - 紧凑 ===== */ @@ -3448,15 +3453,18 @@ html { .honor-grid-item { padding: 12px; max-width: 100%; + min-height: 180px; } .honor-grid-item img { - height: 120px; + width: auto !important; + max-width: 120px; + height: 120px !important; + margin: 0 auto 8px auto; } .honor-grid-name { font-size: 12px; - margin-top: 6px; } /* ===== 新闻 - 紧凑 ===== */ @@ -4002,15 +4010,18 @@ html { .honor-grid-item { padding: 10px; max-width: 100%; + min-height: 150px; } .honor-grid-item img { - height: 100px; + width: auto !important; + max-width: 100px; + height: 100px !important; + margin: 0 auto 6px auto; } .honor-grid-name { font-size: 11px; - margin-top: 4px; } /* ===== 新闻 - 极简 ===== */