CSS

前端自定义浏览器滚动条样式

2024-03-20  本文已影响0人  埼玉的头发

xx.html

<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    ::-webkit-scrollbar {
      width: 8px;
      height: 8px;
    }
    ::-webkit-scrollbar-thumb {
      background: #c29e54;
      border-radius: 5px;
    }
  </style>
</head>
<body>
...
</body>
</html>

xx.css

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-thumb {
  background: #c29e54;
  border-radius: 5px;
}
上一篇 下一篇

猜你喜欢

热点阅读