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

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

来自Blockland Wiki
无编辑摘要
无编辑摘要
第1行: 第1行:
/* --- 1. 隐藏原生页面标题 --- */
/* --- 1. 暴力隐藏 Citizen 自带的页面标题 --- */
/* 只要使用了这个模板,页面原本的标题栏就会消失 */
/* 只要用了这个模板,原来的标题就会消失 */
.mw-body-header {
.mw-body-header {
     display: none !important;
     display: none !important;
}
}


/* --- 2. Hero Banner 容器 --- */
/* --- 2. PageBanner 容器 --- */
.citizen-hero {
.page-banner {
     /* 关键:使用负边距抵消 Citizen 默认的内容内边距,实现“全宽” */
     /* 核心:用负边距抵消 Citizen 的内边距,强制全宽 */
    /* 注意:如果你的 Citizen 版本不同,可能需要微调 -1.5rem 这个数值 */
     margin: -1.5rem -1.5rem 2rem -1.5rem;
     margin-top: -1.5rem;
    margin-left: -1.5rem;
    margin-right: -1.5rem;
      
      
     /* 高度设置:默认占屏幕高度的 55%,保证冲击力 */
     /* 高度:霸气一点,默认 450px 或 屏幕的一半 */
     height: 55vh;  
     height: 50vh;  
     min-height: 400px;
     min-height: 400px;
      
      
第20行: 第17行:
     background-size: cover;
     background-size: cover;
     background-position: center center;
     background-position: center center;
    background-repeat: no-repeat;
      
      
     /* 弹性布局:让文字死死地居中 */
     /* 弹性布局:让文字水平垂直居中 */
     display: flex;
     display: flex;
    flex-direction: column;
     align-items: center;
     align-items: center;
     justify-content: center;
     justify-content: center;
      
      
    /* 底部留点白,别让正文贴着图 */
    margin-bottom: 2rem;
   
    /* 圆角处理:如果你喜欢直角就设为0 */
    border-radius: 0 0 4px 4px;
     overflow: hidden;
     overflow: hidden;
    border-radius: 0 0 8px 8px; /* 底部给点圆角,看着舒服 */
}
}


/* --- 3. 视觉遮罩 (Overlay) --- */
/* --- 3. 黑色遮罩 (保证白字看得清) --- */
/* 加一层半透明黑,防止背景太花看不清字 */
.page-banner-mask {
.citizen-hero::before {
    content: '';
     position: absolute;
     position: absolute;
     top: 0; left: 0; right: 0; bottom: 0;
     top: 0; left: 0; width: 100%; height: 100%;
     background: rgba(0, 0, 0, 0.25); /* 0.25 是透明度,可自己改 */
     background: linear-gradient(to bottom, rgba(0,0,0,0.1) 0%, rgba(0,0,0,0.6) 100%);
     z-index: 1;
     z-index: 1;
}
}


/* --- 4. 只有大标题 --- */
/* --- 4. 文字内容 --- */
.citizen-hero-text {
.page-banner-text {
     position: relative;
     position: relative;
     z-index: 2; /* 保证文字在遮罩上面 */
     z-index: 2;
     text-align: center;
     text-align: center;
     padding: 0 20px;
     width: 90%;
     width: 100%;
    color: #fff;
     text-shadow: 0 4px 8px rgba(0,0,0,0.8);
}
}


.citizen-hero h1 {
/* 大标题 (对应你要求的当地语言名称) */
    color: #ffffff;
.page-banner-title {
    /* 选用衬线体更有“国家/历史”的厚重感 */
     font-size: 3.5rem;
    font-family: 'Linux Libertine', 'Georgia', serif;
     font-weight: 800;
     font-size: 4rem; /* 字号巨大 */
     font-weight: 700;
     line-height: 1.2;
     line-height: 1.2;
    font-family: 'Linux Libertine', 'Georgia', serif; /* 衬线体才有史诗感 */
     margin: 0;
     margin: 0;
    padding: 0;
    border: none;
    text-shadow: 0 4px 12px rgba(0,0,0,0.6); /* 强阴影,提升易读性 */
    letter-spacing: 0.05em;
}
}


/* --- 5. 移动端适配 --- */
/* 适配手机 */
@media screen and (max-width: 720px) {
@media screen and (max-width: 720px) {
     .citizen-hero {
     .page-banner { margin: -1rem -1rem 1.5rem -1rem; height: 35vh; }
        height: 40vh; /* 手机上矮一点 */
     .page-banner-title { font-size: 2.2rem; }
        margin-left: -1rem; /* 手机版 Citizen padding 通常变小 */
        margin-right: -1rem;
    }
     .citizen-hero h1 {
        font-size: 2.5rem; /* 手机上字号减小 */
    }
}
}

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

/* --- 1. 暴力隐藏 Citizen 自带的页面标题 --- */
/* 只要用了这个模板,原来的标题就会消失 */
.mw-body-header {
    display: none !important;
}

/* --- 2. PageBanner 容器 --- */
.page-banner {
    /* 核心:用负边距抵消 Citizen 的内边距,强制全宽 */
    margin: -1.5rem -1.5rem 2rem -1.5rem;
    
    /* 高度:霸气一点,默认 450px 或 屏幕的一半 */
    height: 50vh; 
    min-height: 400px;
    
    position: relative;
    background-size: cover;
    background-position: center center;
    
    /* 弹性布局:让文字水平垂直居中 */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    
    overflow: hidden;
    border-radius: 0 0 8px 8px; /* 底部给点圆角,看着舒服 */
}

/* --- 3. 黑色遮罩 (保证白字看得清) --- */
.page-banner-mask {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(to bottom, rgba(0,0,0,0.1) 0%, rgba(0,0,0,0.6) 100%);
    z-index: 1;
}

/* --- 4. 文字内容 --- */
.page-banner-text {
    position: relative;
    z-index: 2;
    text-align: center;
    width: 90%;
    color: #fff;
    text-shadow: 0 4px 8px rgba(0,0,0,0.8);
}

/* 大标题 (对应你要求的当地语言名称) */
.page-banner-title {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.2;
    font-family: 'Linux Libertine', 'Georgia', serif; /* 衬线体才有史诗感 */
    margin: 0;
}

/* 适配手机 */
@media screen and (max-width: 720px) {
    .page-banner { margin: -1rem -1rem 1.5rem -1rem; height: 35vh; }
    .page-banner-title { font-size: 2.2rem; }
}