跳转到内容

MediaWiki:Common.css:修订间差异

来自休伯利安数据库
Plmxs42​(留言 | 贡献)
无编辑摘要
标签:移动版编辑 移动版网页编辑 高级移动版编辑
Plmxs42​(留言 | 贡献)
无编辑摘要
标签:移动版编辑 移动版网页编辑 高级移动版编辑
第70行: 第70行:
}
}


/* ===== 折叠开关样式(可选) ===== */
/* 折叠开关:设为相对定位的块级元素 */
.timeline-toggle {
.timeline-toggle {
    position: relative;
    display: block;
    padding-right: 25px; /* 右侧留出空位给箭头,防止文字盖住箭头 */
    text-align: left;
     cursor: pointer;
     cursor: pointer;
     font-weight: bold;
     font-weight: bold;
     color: #1B3A5C;
     line-height: 1.5;
    display: inline-block;
}
.timeline-toggle:hover {
    color: #00E5FF;
}
/* 折叠开关的弹性布局 */
.timeline-toggle {
    display: flex;
    justify-content: space-between; /* 标题靠左,三角标靠右 */
    align-items: flex-start;        /* 顶部对齐,防止换行时三角标掉下去 */
    width: 100%;
    cursor: pointer;
    box-sizing: border-box;
    gap: 10px;                     /* 文字和三角标之间的最小距离 */
}
}


/* 标题部分:占据剩余宽度,允许换行 */
/* 标题部分:正常显示 */
.timeline-title {
.timeline-title {
     flex: 1;
     display: inline;
    word-break: break-word;
    line-height: 1.4;
}
}


/* 三角标:固定在右侧,禁止被压缩,微调垂直位置与第一行文字对齐 */
/* 箭头:绝对定位,钉死在右上角 */
.timeline-arrow {
.timeline-arrow {
     flex-shrink: 0;
     position: absolute;
    right: 0;
    top: 0;
    line-height: 1.5; /* 与标题第一行的行高保持一致,实现对齐 */
     font-size: 0.9em;
     font-size: 0.9em;
     margin-top: 3px;               /* 根据字体大小微调,让箭头和第一行文字居中对齐 */
}
 
/* ===== 手机端专属适配:减小内边距,给文字留空间 ===== */
@media screen and (max-width: 600px) {
     /* 减小时间线整体的左边距(原本是70px) */
    .timeline-item {
        padding-left: 50px !important;
        padding-right: 10px !important;
    }
    /* 减小卡片的内部边距(原本是20px 30px) */
    .timeline-content {
        padding: 12px 15px !important;
    }
    /* 强制文字左对齐,防止被意外居中 */
    .timeline-toggle {
        text-align: left !important;
    }
}
}

2026年9月17日 (四) 16:54的版本

/* 这里放置的CSS将应用于所有皮肤 */
/* /* ===== 垂直时间线基础样式 ===== */
.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
    padding: 20px 0;
}
.timeline::after {
    content: '';
    position: absolute;
    width: 4px;
    background-color: #1B3A5C;
    top: 0;
    bottom: 0;
    left: 50%;
    margin-left: -2px;
}
.timeline-item {
    padding: 10px 40px;
    position: relative;
    width: 50%;
    box-sizing: border-box;
}
.timeline-item.left { left: 0; }
.timeline-item.right { left: 50%; }
.timeline-item::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    right: -10px;
    background-color: #FFC107;
    border: 4px solid #00E5FF;
    top: 15px;
    border-radius: 50%;
    z-index: 1;
}
.timeline-item.right::after { left: -10px; }
.timeline-content {
    padding: 20px 30px;
    background-color: #f9f9f9;
    position: relative;
    border-radius: 6px;
    border: 1px solid #ddd;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* ===== 手机端适配:单列显示 ===== */
@media screen and (max-width: 600px) {
    .timeline::after {
        left: 31px;           /* 竖线靠左 */
    }
    .timeline-item {
        width: 100%;
        padding-left: 70px;
        padding-right: 25px;
    }
    .timeline-item.left,
    .timeline-item.right {
        left: 0;              /* 所有卡片左对齐 */
    }
    .timeline-item::after {
        left: 15px;           /* 圆点靠左 */
        right: auto;
    }
    .timeline-item.right::after {
        left: 15px;
    }
}

/* 折叠开关:设为相对定位的块级元素 */
.timeline-toggle {
    position: relative;
    display: block;
    padding-right: 25px; /* 右侧留出空位给箭头,防止文字盖住箭头 */
    text-align: left;
    cursor: pointer;
    font-weight: bold;
    line-height: 1.5;
}

/* 标题部分:正常显示 */
.timeline-title {
    display: inline;
}

/* 箭头:绝对定位,钉死在右上角 */
.timeline-arrow {
    position: absolute;
    right: 0;
    top: 0;
    line-height: 1.5; /* 与标题第一行的行高保持一致,实现对齐 */
    font-size: 0.9em;
}

/* ===== 手机端专属适配:减小内边距,给文字留空间 ===== */
@media screen and (max-width: 600px) {
    /* 减小时间线整体的左边距(原本是70px) */
    .timeline-item {
        padding-left: 50px !important;
        padding-right: 10px !important;
    }
    /* 减小卡片的内部边距(原本是20px 30px) */
    .timeline-content {
        padding: 12px 15px !important;
    }
    /* 强制文字左对齐,防止被意外居中 */
    .timeline-toggle {
        text-align: left !important;
    }
}