From 1d4799663e5250c4a31f4716e06accc16841f354 Mon Sep 17 00:00:00 2001 From: yiqiu Date: Sun, 23 Nov 2025 00:15:06 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=A7=E6=B3=95=E5=A4=9A=E5=A4=A7=E5=95=8A?= =?UTF-8?q?=E5=8F=91=E7=94=9F=E7=9A=84=E5=95=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- css/index.css | 34 +++++++++++++++++++++++++--------- 1 file changed, 25 insertions(+), 9 deletions(-) diff --git a/css/index.css b/css/index.css index d1f5cc4..89dca85 100644 --- a/css/index.css +++ b/css/index.css @@ -20,7 +20,12 @@ box-shadow: 0 4px 24px rgba(15, 23, 42, 0.4); } -/* 首页导航文字颜色 */ +/* 首页导航栏:与轮播图文案、banner-list 保持左对齐 */ +#index .nav-header { + max-width: 1440px; + margin: 0 auto; + padding: 0 20px; +} #index .nav-menu .nav-item { color: #E5E7EB; border-bottom-color: transparent; @@ -183,17 +188,25 @@ } */ -/* 轮播文字层:左侧排列,z-index确保在遮罩之上 */ +/* 轮播文字层:使用与 section-content 相同的左边距计算 */ .banner-cont .swiper-slide .section-content { position: absolute; top: 50%; - left: 8%; - transform: translateY(-50%); - max-width: 650px; + left: 50%; + transform: translate(-50%, -50%); + width: 100%; + max-width: 1440px; + padding: 0 20px; + box-sizing: border-box; z-index: 10; text-align: left; } +/* 文字内容容器,实际的左对齐内容 */ +.banner-cont .swiper-slide .section-content > * { + max-width: 650px; +} + .banner-cont .swiper-slide h1 { font-size: 58px; line-height: 1.2; @@ -1381,9 +1394,9 @@ html { font-size: 44px; } - .banner-cont .swiper-slide .section-content { + /* 小屏幕下保持左对齐布局 */ + .banner-cont .swiper-slide .section-content > * { max-width: 500px; - left: 5%; } /* 已废弃:背景图不需要宽度设置 @@ -1435,10 +1448,13 @@ html { } .banner-cont .swiper-slide .section-content { - left: 50%; - transform: translate(-50%, -50%); text-align: center; + } + + .banner-cont .swiper-slide .section-content > * { max-width: 90%; + margin-left: auto; + margin-right: auto; } .banner-tags {