gpt4 book ai didi

html -::ms-thumb 伪元素拖动后的行为

转载 作者:行者123 更新时间:2023-11-28 03:10:19 25 4
gpt4 key购买 nike

有没有人对 IE11 中输入范围控件上的 ms-thumb 伪元素的样式和控制行为有任何经验?

如果控件比 thumb 伪元素高,则拖动后 thumb 会粘在顶部并且不会返回到它的原始位置。

Here's an example of the behaviour on codepen and the css being used (requires IE11 or Project Spartan/Edge)

.c-slider{
height: 60px;
background-color: #99CCFF;
padding:0px;
}

/*Slider Specific Styling*/

input[type=range]::-ms-thumb {
width: 30px;
height:7px;
border:1px solid #0066CC;
background-color:#0066CC;
cursor:pointer;
}

input[type=range]::-ms-thumb:active{
background-color:green;
}

input[type=range]::-ms-thumb:hover{
height: 60px;
width: 30px;
}

input[type=range]::-ms-fill-lower {
background: #A1A1A1;
}

input[type=range]::-ms-fill-upper {
background: #EBF5FF;
}


/*Slider Reset Css*/
input[type=range] {
-webkit-appearance: none; /* Hides the slider so that custom slider can be made */
width: 100%; /* Specific width is required for Firefox. */
}

input[type=range]::-webkit-slider-thumb {
-webkit-appearance: none;
}

input[type=range]:focus {
outline: none; /* Removes the blue border. You should probably do some kind of focus styling for accessibility reasons though. */
}


input[type=range]::-ms-track {
width: 100%;
cursor: pointer;
background: transparent; /* Hides the slider so custom styles can be added */
border-color: transparent;
color: transparent;
}

最佳答案

尝试将 thumb 的顶部和底部边距设置为 thumb 高度和控件高度之间差值的一半。

关于html -::ms-thumb 伪元素拖动后的行为,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30865226/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com