Vue custom scroll bar style

Google Chrome

  .uc-table {
    
    /*这是爸爸*/
    width: 90%;
    height: 70%;
    overflow: auto;
    margin: auto;
  }
  .uc-table::-webkit-scrollbar {
    
    /*滚动条整体样式*/
    width: 10px;     /*高宽分别对应横竖滚动条的尺寸*/
    height: 1px;
}
  .uc-table::-webkit-scrollbar-thumb {
    
    /*滚动条里面小方块*/
    border-radius: 10px;
     -webkit-box-shadow: inset 0 0 5px rgba(0,0,0,0.2);
    background: #535353;
}
.uc-table::-webkit-scrollbar-track {
    
    /*滚动条里面轨道*/
    -webkit-box-shadow: inset 0 0 5px rgba(0,0,0,0.2);
    border-radius: 10px;
    background: #EDEDED;
}

Effect picture:
Insert picture description here

Firefox browser

* {
    
    
  scrollbar-color: #e5e5e5 #f7f7f9; /* 滑块颜色  滚动条背景颜色 */
  scrollbar-width: thin; /* 滚动条宽度有三种:thin、auto、none */
}

Effect picture:
Insert picture description here

Guess you like

Origin blog.csdn.net/qq_44977477/article/details/103526307