我正在尝试更改应用程序中悬停时的滚动条颜色,由于某种原因,当我将鼠标悬停在其上时,它会变成红色。这是我的代码:
.scroller {
position: absolute;
top: 120px;
bottom: 0;
left: 0;
right: 0;
padding: 0;
margin-bottom: 10px;
overflow: auto;
Run Code Online (Sandbox Code Playgroud)
}
.scrooler:hover{
color: blue;
}
Run Code Online (Sandbox Code Playgroud)
使用这段代码,它所做的就是当我将鼠标悬停在表格上时,所有文本都会变成蓝色。我很难只获得滚动条,因为我认为它直接在表格内。有没有办法只针对滚动条?
小智 7
尝试这个:
.scroller::-webkit-scrollbar-thumb:vertical:hover {
background-color: #000;
}
Run Code Online (Sandbox Code Playgroud)