小编Acm*_*ion的帖子

CSS ::-webkit-scrollbar 禁用双按钮

当通过选择器在 CSS 中使用自定义滚动条样式时::-webkit-scrollbar,根据display目标元素的属性,可以获取 asingle-button或 a double-button

请参阅下面的示例,该示例显示了带有display: flex和的元素的不同行为display: block

body
{
  background: #111;
  color: white;
}

.wrapper
{
  height: 150px; 
  overflow-y: scroll; 
  background: #333; 
  display: flex; 
  padding: 10px;
}

.wrapper > div
{
  height: 300px;
}

.custom-scrollbar::-webkit-scrollbar 
{ 
  width: 16px; 
  height: 16px;
}

.custom-scrollbar::-webkit-scrollbar-track-piece 
{ 
  background-color: #444;
}

.custom-scrollbar::-webkit-scrollbar-thumb 
{  
  background: #555;
}

.custom-scrollbar::-webkit-scrollbar-button
{
  background: #666;
}

.custom-scrollbar::-webkit-scrollbar-button:vertical:decrement,
.custom-scrollbar::-webkit-scrollbar-button:vertical:increment,
.custom-scrollbar::-webkit-scrollbar-button:horizontal:decrement,
.custom-scrollbar::-webkit-scrollbar-button:horizontal:increment
{
  border: 1px solid #000;
}


.custom-scrollbar::-webkit-scrollbar-button:single-button:vertical:decrement, …
Run Code Online (Sandbox Code Playgroud)

css webkit google-chrome scrollbar

5
推荐指数
1
解决办法
2392
查看次数

标签 统计

css ×1

google-chrome ×1

scrollbar ×1

webkit ×1