【发布时间】:2023-03-15 02:48:01
【问题描述】:
#slider1 {
-webkit-appearance: slider-vertical; /* This makes ... */
background-color: black;
width: 1px;
height: 100px;
}
#slider2 {
-webkit-appearance: none; /* the difference. */
background-color: black;
width: 100px;
height: 1px;
}
#slider1::-webkit-slider-thumb,
#slider2::-webkit-slider-thumb {
-webkit-appearance: none;
appearance: none;
width: 25px;
height: 25px;
background: #04aa6d;
cursor: pointer;
}
#slider1::-webkit-slider-thumb:hover,
#slider2::-webkit-slider-thumb:hover {
width: 20px;
height: 20px;
}
<input type="range" id="slider1" />
<input type="range" id="slider2" />
如图所示,两个滑块的 CSS 样式几乎相同,除了 -webkit-appearance 属性。但是水平滑块(这是默认滑块)接受样式,而垂直滑块拒绝它。我在 Chrome 上。如何让它发挥作用?谢谢!
【问题讨论】:
-
它回答了你的问题吗? stackoverflow.com/questions/18389224/…
-
@AbhishekPandey 我以前看过这个页面,没有提到样式。
-
@TonyStark 这个问题似乎与垂直滑块样式无关:/