前端给div加滚动条样式修改
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>滚动条示例</title> <style type="text/css"> .nui-scroll { margin-left: 100px; border: 1px solid #000; width: 200px; height: 100px; overflow: auto; } .nui-scroll::-webkit-scrollbar { width: 8px; height: 8px; } /*正常情况下滑块的样式*/ .nui-scroll::-webkit-scrollbar-thumb { background-color: rgba(0, 0, 0, .05); border-radius: 10px; -webkit-box-shadow: inset 1px 1px 0 rgba(0, 0, 0, .1); } /*鼠标悬浮在该类指向的控件上时滑块的样式*/ .nui-scroll:hover::-webkit-scrollbar-thumb { background-color: rgba(0, 0, 0, .2); border-radius: 10px; -webkit-box-shadow: inset 1px