看完这个
codepen
我终于找到了合适的滚动条来解决这个问题!
css
.custom-panel-siteId {
margin: 40px 0px !important;
min-width: 313px !important;
margin-left: 17px !important;
border-radius: 5px !important;
}
.custom-panel-siteId::-webkit-scrollbar {
width: 20px;
height: 12px;
background-color: #f1f1f1;
border-radius: 5px;
}
.custom-panel-siteId::-webkit-scrollbar-thumb {
border-radius: 1px;
background-color: #c1c1c1;
}
.custom-panel-siteId::-webkit-scrollbar-thumb:hover {
background-color: #a8a8a8;
border-radius: 5px;
}
.custom-panel-siteId::-webkit-scrollbar-thumb:horizontal {
border-top: 2px solid #f1f1f1;
border-bottom: 2px solid #f1f1f1;
}
.custom-panel-siteId::-webkit-scrollbar-thumb:vertical {
border-left: 2px solid #f1f1f1;
border-right: 2px solid #f1f1f1;
}
.custom-panel-siteId::-webkit-scrollbar-thumb:active {
background-color: #787878;
}
.custom-panel-siteId::-webkit-scrollbar-track-piece {
}
.custom-panel-siteId::-webkit-scrollbar-track {
background-color: #f1f1f1;
border-radius: 5px;
}
/* Buttons */
.custom-panel-siteId::-webkit-scrollbar-button {
background-color: #f1f1f1;
background-repeat: no-repeat;
background-size: 7px;
background-position: center;
height: 17px;
width: 17px;
border-radius: 5px;
}
.custom-panel-siteId::-webkit-scrollbar-button:disabled {
/* Why is this not red??? */
background-color: red;
}
.custom-panel-siteId::-webkit-scrollbar-button:hover {
background-color: #d2d2d2;
}
.custom-panel-siteId::-webkit-scrollbar-button:active {
background-color: #787878;
}
/* Up */
.custom-panel-siteId::-webkit-scrollbar-button:vertical:decrement {
background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='100' height='100' fill='%23505050'><polygon points='50,30 100,80 0,80'/></svg>");
}
.custom-panel-siteId::-webkit-scrollbar-button:vertical:decrement:active {
background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='100' height='100' fill='%23FFFFFF'><polygon points='50,30 100,80 0,80'/></svg>");
}
.custom-panel-siteId::-webkit-scrollbar-button:vertical:decrement:hover {
border-color: transparent transparent #505050 transparent;
}
/* Down */
.custom-panel-siteId::-webkit-scrollbar-button:vertical:increment {
background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='100' height='100' fill='%23505050'><polygon points='0,15 100,15 50,75'/></svg>");
}
.custom-panel-siteId::-webkit-scrollbar-button:vertical:increment:hover {
border-color: #505050 transparent transparent transparent;
}
/* Left */
.custom-panel-siteId::-webkit-scrollbar-button:horizontal:decrement {
background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='100' height='100' fill='%23505050'><polygon points='15,50 75,100 75,0'/></svg>");
}
.custom-panel-siteId::-webkit-scrollbar-button:horizontal:decrement:hover {
border-color: transparent #505050 transparent transparent;
}
/* Right */
.custom-panel-siteId::-webkit-scrollbar-button:horizontal:increment {
background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='100' height='100' fill='%23505050'><polygon points='15,0 15,100 75,50'/></svg>");
}
.custom-panel-siteId::-webkit-scrollbar-button:horizontal:increment:hover {
border-color: transparent transparent transparent #505050;
}
stackblitz