打开/关闭菜单
打开/关闭外观设置菜单
打开/关闭个人菜单
未登录
未登录用户的IP地址会在进行任意编辑后公开展示。

模板:PageBanner/styles.css:修订间差异

来自Blockland Wiki
无编辑摘要
无编辑摘要
第1行: 第1行:
/* --- 1. 隐藏 Citizen 原生标题 --- */
/* --- 1. 暴力隐藏 Citizen 各类原生标题 --- */
.mw-body-header {
.mw-body-header,
.citizen-page-header,
#firstHeading,
.firstHeading {
     display: none !important;
     display: none !important;
}
/* 修正 Citizen 顶部间距,让 Banner 顶上去 */
.mw-body, #content {
    margin-top: 0 !important;
    padding-top: 0 !important;
}
}


第7行: 第16行:
.page-banner {
.page-banner {
     position: relative;
     position: relative;
     /* 高度 */
     height: 450px; /* 你想要的高度 */
     height: 450px;  
     width: 100%;
    /* 抵消顶部边距 */
     margin-top: -1.5rem; /* 抵消默认 padding */
     margin-top: -1.5rem;  
     margin-bottom: 2rem;
     margin-bottom: 2rem;
     z-index: 1;
     z-index: 0;
    overflow: visible; /* 关键:允许子元素超出容器 */
}
}


/* --- 3. 背景层(修正版) --- */
/* --- 3. 背景层(负责全宽和图片) --- */
.page-banner-bg {
.page-banner-bg {
     position: absolute;
     position: absolute;
第21行: 第30行:
     height: 100%;
     height: 100%;
      
      
     /* 逃逸逻辑:撑满屏幕 */
     /* === 核心修复:强制全宽逃逸 === */
     width: 100vw;
     width: 100vw;
     left: 50%;
     left: 50%;
    right: 50%;
     margin-left: -50vw;  
     margin-left: -50vw;
     /* 如果出现横向滚动条,可以尝试改成 width: 99.5vw 或 100% */
     margin-right: -50vw;
      
      
     background-size: cover;
     background-size: cover;
     background-position: center;
     background-position: center;
     z-index: -1;
     z-index: -2; /* 最底层 */
}
}


/* === 核心修复:用伪元素模拟“渐隐遮罩” === */
/* --- 4. 渐变遮罩层(修复透明渐变) --- */
/* 这一层盖在图片上,从透明渐变到页面背景色 */
.page-banner-overlay {
.page-banner-bg::after {
    content: "";
     position: absolute;
     position: absolute;
     top: 0;
     top: 0;
    left: 0;
    width: 100%;
     height: 100%;
     height: 100%;
     /* Citizen 皮肤变量:--color-surface-1 是正文背景色 */
   
     /* 意思是:上部透明,下部渐变到背景色,实现“融入”效果 */
     /* 同样应用全宽逃逸逻辑 */
     background: linear-gradient(to bottom, rgba(0,0,0,0) 60%, var(--color-surface-1, #ffffff) 100%);
    width: 100vw;
    left: 50%;
    margin-left: -50vw;
   
    /* 线性渐变:上部透明 -> 底部变为网页背景色 */
     /* var(--color-surface-1) 是 Citizen 的背景色变量,自动适配深色模式 */
     background: linear-gradient(to bottom, rgba(0,0,0,0) 40%, var(--color-surface-1, #ffffff) 100%);
    z-index: -1; /* 在图片之上,文字之下 */
}
}


/* --- 4. 内容层 --- */
/* --- 5. 内容层(负责文字对齐) --- */
.page-banner-content {
.page-banner-content {
     position: relative;
     position: relative;
     height: 100%;
     height: 100%;
     max-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: 80px;  
     padding-bottom: 60px; /* 底部留白 */
     z-index: 2;
     z-index: 1;
}
}


/* --- 5. 文字样式 --- */
/* --- 6. 文字样式 --- */
.page-banner-local {
.page-banner-local {
     font-family: 'Linux Libertine', 'Georgia', serif;  
     font-family: 'Linux Libertine', 'Georgia', 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 15px rgba(0,0,0,0.6);
     text-shadow: 0 4px 15px rgba(0,0,0,0.8);  
}
}


.page-banner-en {
.page-banner-en {
     font-family: sans-serif;
     font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
     font-size: 1.8em;
     font-size: 1.5em;
     font-weight: 300;
     font-weight: 500;
     color: rgba(255, 255, 255, 0.95);
     color: rgba(255, 255, 255, 0.85);
     margin-top: 5px;
     margin-top: 8px;
     letter-spacing: 2px;
     letter-spacing: 1px;
     text-transform: uppercase;
     text-transform: uppercase;
     text-shadow: 0 2px 5px rgba(0,0,0,0.9);
     text-shadow: 0 2px 5px rgba(0,0,0,0.8);
}
}


第89行: 第100行:
     .page-banner { height: 300px; }
     .page-banner { height: 300px; }
     .page-banner-local { font-size: 2.5em; }
     .page-banner-local { font-size: 2.5em; }
     .page-banner-en { font-size: 1.2em; }
     .page-banner-en { font-size: 1.1em; }
}
}

2026年1月30日 (五) 16:30的版本

/* --- 1. 暴力隐藏 Citizen 各类原生标题 --- */
.mw-body-header,
.citizen-page-header,
#firstHeading,
.firstHeading {
    display: none !important;
}

/* 修正 Citizen 顶部间距,让 Banner 顶上去 */
.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; /* 抵消默认 padding */
    margin-bottom: 2rem;
    z-index: 0;
    overflow: visible; /* 关键:允许子元素超出容器 */
}

/* --- 3. 背景层(负责全宽和图片) --- */
.page-banner-bg {
    position: absolute;
    top: 0;
    height: 100%;
    
    /* === 核心修复:强制全宽逃逸 === */
    width: 100vw;
    left: 50%;
    margin-left: -50vw; 
    /* 如果出现横向滚动条,可以尝试改成 width: 99.5vw 或 100% */
    
    background-size: cover;
    background-position: center;
    z-index: -2; /* 最底层 */
}

/* --- 4. 渐变遮罩层(修复透明渐变) --- */
.page-banner-overlay {
    position: absolute;
    top: 0;
    height: 100%;
    
    /* 同样应用全宽逃逸逻辑 */
    width: 100vw;
    left: 50%;
    margin-left: -50vw;
    
    /* 线性渐变:上部透明 -> 底部变为网页背景色 */
    /* var(--color-surface-1) 是 Citizen 的背景色变量,自动适配深色模式 */
    background: linear-gradient(to bottom, 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: 'Linux Libertine', 'Georgia', serif;
    font-size: 4em;
    font-weight: 900;
    color: #ffffff; /* 强制白色 */
    line-height: 1.1;
    margin: 0;
    text-shadow: 0 4px 15px rgba(0,0,0,0.6);
}

.page-banner-en {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 1.5em;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.85);
    margin-top: 8px;
    letter-spacing: 1px;
    text-transform: uppercase;
    text-shadow: 0 2px 5px rgba(0,0,0,0.8);
}

/* 移动端适配 */
@media screen and (max-width: 720px) {
    .page-banner { height: 300px; }
    .page-banner-local { font-size: 2.5em; }
    .page-banner-en { font-size: 1.1em; }
}