跳转到内容

模板:背景图片/styles.css

来自SS唯基
/* [[Category:CSS页面]] */
/* ===== 全屏背景图片 - 容器与图片层 ===== */
.wiki-bg-outer > span,
.wiki-bg-outer > span > span {
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%;
    max-width: none; 
    margin: 0; 
    padding: 0; 
    display: block; 
    border: none;
}

/* 图片本身 */
.wiki-bg-outer .mw-file-element {
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%;
    max-width: 100%; /* 限制最大宽度为100% */
    max-height: 100%; /* 限制最大高度为100% */
    object-fit: cover; /* 确保图片覆盖整个区域 */
    object-position: center center; 
    opacity: 0.9; /* 浅色模式下的透明度 */
    z-index: 0; /* 设置为最底层 */
}

/* 深色模式下的透明度 */
@media (prefers-color-scheme: dark) {
    .wiki-bg-outer .mw-file-element {
        opacity: 0.9; /* 深色模式下的透明度 */
    }
}

/* ===== 文本样式 ===== */
.mw-body-header,
.vector-page-toolbar,
.mw-portlet {
    color: white; /* 文本颜色 */
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.7); /* 添加阴影以增强可读性 */
    position: relative; /* 确保文本在最上层 */
    z-index: 1000; /* 确保导航栏在最上层 */
    opacity: 1; /* 确保文本初始状态为可见 */
}

/* ===== 其他可能的样式 ===== */
.mw-page-title-main {
    z-index: 1001; /* 确保标题文本在最上层 */
}

.vector-page-toolbar {
    z-index: 1001; /* 确保工具栏文本在最上层 */
}