<div class="scroll-container">
  <div class="scroll-content"></div>
</div>
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
  border-radius: 3px;
}

/* 滚动条滑块(里面小方块) */
::-webkit-scrollbar-thumb {
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.1);
}

/* 滚动条轨道 */
::-webkit-scrollbar-track {
  border-radius: 3px;
  background: rgba(0, 0, 0, 0);
}

::-webkit-scrollbar-track-piece {
  background-color: rgba(0, 0, 0, 0);
  border-radius: 0;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.2);
}

.scroll-container {
  width: 400px;
  height: 200px;
  overflow: auto;
}

.scroll-content {
  width: 100%;
  height: 400px;
}
View Compiled

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.