如何使webkit-scrollbar仅在一个div上可见?

我有一些溢出的水平内容,并且希望始终显示滚动条以支持Windows设备,但是我不想在其他任何地方使用滚动条。 `

 ::-webkit-scrollbar {
    display: none;
}
.polls-row::-webkit-scrollbar {
    height: 1rem;
}

.polls-row::-webkit-scrollbar-track {
    box-shadow: inset 0 0 6px rgba(0,0.3);
    -webkit-box-shadow: inset 0 0 6px rgba(0,0.3);
}

.polls-row::-webkit-scrollbar-thumb {
  background-color: $color-border;
  border-radius: $radius;
  outline: 1px solid slategrey;
}

我有这个CSS / sass,我认为它应该起作用,因为该类具有更高的特异性,但是我仍然没有在.polls-row上找到滚动条

我该怎么做?

tabby37 回答:如何使webkit-scrollbar仅在一个div上可见?

使用以下CSS更新代码

test   al,al
jne    0x514 <asm4+23>
mov    DWORD PTR [ebp-0x8],0x1
jmp    0x587 <asm4+138>
mov    edx,DWORD PTR [ebp-0x8]
本文链接:https://www.f2er.com/3130530.html

大家都在问