• Moegirl.ICU:萌娘百科流亡社群 581077156(QQ),欢迎对萌娘百科运营感到失望的编辑者加入
  • Moegirl.ICU:账号认领正在试运行,有意者请参照账号认领流程

Template:Slider/styles.css

萌娘百科,万物皆可萌的百科全书!转载请标注来源页面的网页链接,并声明引自萌娘百科。内容不可商用。
跳转到导航 跳转到搜索
/* 滑块容器样式 */
.slider-container {
    position: relative;
    display: block;
    min-width: 100%;
    height: 32px;
    margin: 15px 0;
    touch-action: none;
    box-sizing: border-box;
}

/* 滑轨样式 */
.slider-track {
    position: absolute;
    width: inherit;
    min-width: 100%;
    height: 6px;
    top: 13px;
    background-color: #24b44a;
    border-radius: 3px;
    box-sizing: border-box;
}

/* 滑块本体样式 */
.slider-thumb {
    position: absolute;
    width: 24px;
    height: 24px;
    left: 0;
    top: 5px;
    background-color: #ffffff;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    cursor: pointer;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
}

/* 滑块图标样式 */
.slider-icon {
    width: 12px;
    height: 12px;
    background-color: #333333;
    border-radius: 50%;
}

/* 数值显示 - 修正版 */
.slider-value {
    position: absolute;
    top: -20px;
    left: 0;
    right: 0;
    margin: 0 auto;
    display: inline-block;
    font-size: 12px;
    background-color: #f5f5f5;
    padding: 2px 8px;
    border-radius: 12px;
    white-space: nowrap;
    min-width: 30px;
    max-width: 100%;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    box-sizing: border-box;
}

/* 最小/最大值标签 */
.slider-minmax {
    position: absolute;
    top: 20px;
    font-size: 11px;
    color: #666;
    user-select: none;
}

.slider-min {
    left: 0;
}

.slider-max {
    right: 0;
}

/* 响应式调整 */
@media (max-width: 480px) {
    .slider-container {
        height: 28px;
    }
    .slider-thumb {
        width: 20px;
        height: 20px;
        top: 4px;
    }
    .slider-icon {
        width: 10px;
        height: 10px;
    }
    .slider-value {
        font-size: 11px;
        top: -18px;
    }
}