gpt4 book ai didi

css - 使用样式化组件样式化 slider 拇指

转载 作者:技术小花猫 更新时间:2023-10-29 11:11:58 26 4
gpt4 key购买 nike

我正在尝试使用 React 的样式化组件来设计 slider 样式,但我不知道如何设计拇指样式。我有一个看起来像这样的 CSS:

.faderInput::-webkit-slider-thumb {
-webkit-appearance: none;
width: 15px;
height: 15px;
border:1px solid black;
...
}

我的样式组件看起来像这样

const FaderInput = styled.input`
...
::-webkit-slider-thumb {
-webkit-appearance: none;
width: 15px;
height: 15px;
border:1px solid black;
...
}
`;

有人知道如何将此类选择器移植到样式组件吗?

最佳答案

我真的得到了帮助。你必须添加一个 & 然后它看起来像这样:

 const FaderInput = styled.input`
...
&::-webkit-slider-thumb {
-webkit-appearance: none;
width: 15px;
height: 15px;
border:1px solid black;
...
}

关于css - 使用样式化组件样式化 slider 拇指,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47921532/

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