CSS implements hidden scrollbar but scrollable

Scenes

Hide the scrollbar, but allow scrolling

solve

global style

/* 隐藏滚动条 */
.outer-container::-webkit-scrollbar {
    
    
  width: 0; /* 设置滚动条的宽度为0 */
  background-color: transparent; /* 设置滚动条背景为透明 */
}

/* 自定义滚动条轨道样式 */
.outer-container::-webkit-scrollbar-track {
    
    
  background-color: transparent; /* 设置滚动条轨道背景为透明 */
}

/* 自定义滚动条滑块样式 */
.outer-container::-webkit-scrollbar-thumb {
    
    
  background-color: transparent; /* 设置滚动条滑块背景为透明 */
}

epilogue

Thank readers for reading and following blog posts, and express gratitude for opinions, suggestions, or criticisms mentioned in articles

Guess you like

Origin blog.csdn.net/qq_54334713/article/details/132606318