美文网首页
css视觉--自定义滚动条

css视觉--自定义滚动条

作者: 怪兽别跑biubiubi | 来源:发表于2018-03-23 15:05 被阅读0次
    <!DOCTYPE html>
    <html lang="en">
    <head>
      <meta charset="UTF-8">
      <meta name="viewport" content="width=device-width, initial-scale=1.0">
      <meta http-equiv="X-UA-Compatible" content="ie=edge">
      <title>自定义滚动条</title>
      <style>
        .custom-scrollbar {
          height: 60px;
          overflow: auto;
        }
        .custom-scrollbar::-webkit-scrollbar {
          width: 10px;
        }
        .custom-scrollbar::-webkit-scrollbar-track {
          box-shadow: inset 0 0 6px #333;
          border-radius: 10px;
        }
        .custom-scrollbar::-webkit-scrollbar-thumb {
          box-shadow: inset 0 0 6px #333;
          border-radius: 10px;
        }
      </style>
    </head>
    <body>
      <div class="custom-scrollbar">
        <p>
          Lorem ipsum dolor sit amet 
          consectetur adipisicing elit. Iure id 
          exercitationem nulla qui repellat laborum vitae,
          molestias tempora velit natus. Quas, assumenda nisi. 
          Quisquam enim qui iure, 
          consequatur velit sit?Lorem ipsum dolor sit amet consectetur adipisicing elit. 
          Iure id exercitationem nulla qui repellat laborum vitae, molestias tempora velit natus. 
          Quas, assumenda nisi. Quisquam enim qui iure, consequatur velit sit?
          Lorem ipsum dolor sit amet 
          consectetur adipisicing elit. Iure id 
          exercitationem nulla qui repellat laborum vitae,
          molestias tempora velit natus. Quas, assumenda nisi. 
          Quisquam enim qui iure, 
          ::-webkit-scrollbar 定位整个滚动条元素。
          ::-webkit-scrollbar-track 仅针对滚动条轨道。
          ::-webkit-scrollbar-thumb 瞄准滚动条拇指。
        </p>
      </div>
    </body>
    </html>

    相关文章

      网友评论

          本文标题:css视觉--自定义滚动条

          本文链接:https://www.haomeiwen.com/subject/xalxcftx.html