模板:PageBanner/styles.css:修订间差异
来自Blockland Wiki
更多操作
无编辑摘要 |
无编辑摘要 |
||
| 第1行: | 第1行: | ||
/* --- 1. 暴力隐藏 Citizen | /* --- 1. 暴力隐藏 Citizen 及原生标题 --- */ | ||
.mw-body-header, | .mw-body-header, | ||
.citizen-page-header, | .citizen-page-header, | ||
#firstHeading, | #firstHeading, | ||
.firstHeading { | .firstHeading, | ||
.page-heading { /* 增加一个常见的 Citizen 标题类名 */ | |||
display: none !important; | display: none !important; | ||
} | } | ||
/* 修正 Citizen | /* 修正 Citizen 顶部间距 */ | ||
.mw-body, #content { | .mw-body, #content { | ||
margin-top: 0 !important; | margin-top: 0 !important; | ||
| 第16行: | 第17行: | ||
.page-banner { | .page-banner { | ||
position: relative; | position: relative; | ||
height: 450px; | height: 450px; | ||
width: 100%; | width: 100%; | ||
margin-top: -1.5rem; | margin-top: -1.5rem; | ||
margin-bottom: 2rem; | margin-bottom: 2rem; | ||
z-index: 0; | z-index: 0; | ||
} | } | ||
/* --- 3. | /* --- 3. 背景层(全宽黑科技) --- */ | ||
.page-banner-bg { | .page-banner-bg { | ||
position: absolute; | position: absolute; | ||
| 第30行: | 第30行: | ||
height: 100%; | height: 100%; | ||
/* | /* 强制全宽 */ | ||
width: 100vw; | width: 100vw; | ||
left: 50%; | left: 50%; | ||
margin-left: -50vw; | margin-left: -50vw; | ||
background-size: cover; | background-size: cover; | ||
background-position: center; | background-position: center center; /* 确保图片居中 */ | ||
z-index: -2; | z-index: -2; | ||
} | } | ||
/* --- 4. | /* --- 4. 渐变遮罩层 --- */ | ||
.page-banner-overlay { | .page-banner-overlay { | ||
position: absolute; | position: absolute; | ||
| 第47行: | 第46行: | ||
height: 100%; | height: 100%; | ||
width: 100vw; | width: 100vw; | ||
left: 50%; | left: 50%; | ||
margin-left: -50vw; | margin-left: -50vw; | ||
/* | /* 调整了一下渐变,让文字更清晰 */ | ||
background: linear-gradient(to bottom, rgba(0,0,0,0.2) 0%, rgba(0,0,0,0) 40%, var(--color-surface-1, #ffffff) 100%); | |||
background: linear-gradient(to bottom, rgba(0,0,0,0) 40%, var(--color-surface-1, #ffffff) 100%); | z-index: -1; | ||
z-index: -1; | |||
} | } | ||
/* --- 5. | /* --- 5. 内容层 --- */ | ||
.page-banner-content { | .page-banner-content { | ||
position: relative; | position: relative; | ||
height: 100%; | height: 100%; | ||
width: 100%; | width: 100%; | ||
display: flex; | display: flex; | ||
flex-direction: column; | flex-direction: column; | ||
justify-content: flex-end; | justify-content: flex-end; | ||
align-items: flex-start; | align-items: flex-start; | ||
padding-bottom: 60px; | padding-bottom: 60px; | ||
z-index: 1; | z-index: 1; | ||
} | } | ||
/* --- 6. 文字样式 --- */ | /* --- 6. 文字样式 (已修改为无衬线) --- */ | ||
.page-banner-local { | .page-banner-local { | ||
font-family: ' | /* 这里的字体栈是现代无衬线风格 */ | ||
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Microsoft YaHei', sans-serif; | |||
font-size: 4em; | font-size: 4em; | ||
font-weight: 900; | font-weight: 900; | ||
color: #ffffff; | color: #ffffff; | ||
line-height: 1.1; | line-height: 1.1; | ||
margin: 0; | margin: 0; | ||
text-shadow: 0 4px | /* 增加文字阴影,防止背景太白看不清 */ | ||
text-shadow: 0 4px 20px rgba(0,0,0,0.5); | |||
} | } | ||
.page-banner-en { | .page-banner-en { | ||
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; | font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; | ||
font-size: 1.5em; | font-size: 1.5em; | ||
font-weight: 500; | font-weight: 500; | ||
color: rgba(255, 255, 255, 0. | color: rgba(255, 255, 255, 0.9); | ||
margin-top: 8px; | margin-top: 8px; | ||
letter-spacing: 1px; | letter-spacing: 1px; | ||
text-transform: uppercase; | text-transform: uppercase; | ||
text-shadow: 0 2px | text-shadow: 0 2px 10px rgba(0,0,0,0.7); | ||
} | } | ||
2026年1月30日 (五) 16:34的版本
/* --- 1. 暴力隐藏 Citizen 及原生标题 --- */
.mw-body-header,
.citizen-page-header,
#firstHeading,
.firstHeading,
.page-heading { /* 增加一个常见的 Citizen 标题类名 */
display: none !important;
}
/* 修正 Citizen 顶部间距 */
.mw-body, #content {
margin-top: 0 !important;
padding-top: 0 !important;
}
/* --- 2. Banner 主容器 --- */
.page-banner {
position: relative;
height: 450px;
width: 100%;
margin-top: -1.5rem;
margin-bottom: 2rem;
z-index: 0;
}
/* --- 3. 背景层(全宽黑科技) --- */
.page-banner-bg {
position: absolute;
top: 0;
height: 100%;
/* 强制全宽 */
width: 100vw;
left: 50%;
margin-left: -50vw;
background-size: cover;
background-position: center center; /* 确保图片居中 */
z-index: -2;
}
/* --- 4. 渐变遮罩层 --- */
.page-banner-overlay {
position: absolute;
top: 0;
height: 100%;
width: 100vw;
left: 50%;
margin-left: -50vw;
/* 调整了一下渐变,让文字更清晰 */
background: linear-gradient(to bottom, rgba(0,0,0,0.2) 0%, rgba(0,0,0,0) 40%, var(--color-surface-1, #ffffff) 100%);
z-index: -1;
}
/* --- 5. 内容层 --- */
.page-banner-content {
position: relative;
height: 100%;
width: 100%;
display: flex;
flex-direction: column;
justify-content: flex-end;
align-items: flex-start;
padding-bottom: 60px;
z-index: 1;
}
/* --- 6. 文字样式 (已修改为无衬线) --- */
.page-banner-local {
/* 这里的字体栈是现代无衬线风格 */
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Microsoft YaHei', sans-serif;
font-size: 4em;
font-weight: 900;
color: #ffffff;
line-height: 1.1;
margin: 0;
/* 增加文字阴影,防止背景太白看不清 */
text-shadow: 0 4px 20px rgba(0,0,0,0.5);
}
.page-banner-en {
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
font-size: 1.5em;
font-weight: 500;
color: rgba(255, 255, 255, 0.9);
margin-top: 8px;
letter-spacing: 1px;
text-transform: uppercase;
text-shadow: 0 2px 10px rgba(0,0,0,0.7);
}
/* 移动端适配 */
@media screen and (max-width: 720px) {
.page-banner { height: 300px; }
.page-banner-local { font-size: 2.5em; }
.page-banner-en { font-size: 1.1em; }
}