美文网首页
CSS 隐藏滚动条

CSS 隐藏滚动条

作者: 草帽lufei | 来源:发表于2019-12-29 17:23 被阅读0次

    css ::-webkit-scrollbar

    <html>
      <head>
        <title>-webkit-scrollbar</title>
        <style type="text/css">
          .div1 {
            width:800px;height:100px;overflow-y: auto;border:1px solid #ccc;
          }
          .div2 {
            width:800px;height:100px;overflow-y: auto;border:1px solid #ccc;
          }
          .div2::-webkit-scrollbar {
            display:none;
          }
        </style>
      </head>
      <body>
        <div>
          <h2>CSS 自定义滚动条</h2>
          <div class="div1">
            <p>Falling in love with you was the easiest thing I’ve ever done.</p>
            <p>爱上你是我做过的最容易的一件事。</p>
            <p>There are all kinds of people in this world. It happens that we have become friends. This is not fate. It is just that we should be friends.</p>
            <p>这世界上有各种各样的人,恰巧我们成为了朋友,这不是缘分,仅仅只是我们本就应该是朋友。</p>
            <p>The world’s full of lonely people afraid to make the first move.</p>
            <p>这个世界每一个孤独的人都害怕迈出第一步。</p>
            <p>They don’t have a choice, but you do.</p>
            <p>他们没得选择,但你有。</p>
            <p>You never win with violence. You only win when you maintain your dignity.</p>
            <p>你永远不会以暴力取胜。只有保持尊严才能战胜一切。</p>
          </div>
          <br>
          <br>
          <br>
          <br>
          <div class="div2">
            <p>Falling in love with you was the easiest thing I’ve ever done.</p>
            <p>爱上你是我做过的最容易的一件事。</p>
            <p>There are all kinds of people in this world. It happens that we have become friends. This is not fate. It is just that we should be friends.</p>
            <p>这世界上有各种各样的人,恰巧我们成为了朋友,这不是缘分,仅仅只是我们本就应该是朋友。</p>
            <p>The world’s full of lonely people afraid to make the first move.</p>
            <p>这个世界每一个孤独的人都害怕迈出第一步。</p>
            <p>They don’t have a choice, but you do.</p>
            <p>他们没得选择,但你有。</p>
            <p>You never win with violence. You only win when you maintain your dignity.</p>
            <p>你永远不会以暴力取胜。只有保持尊严才能战胜一切。</p>
          </div>
        </div>
      </body>
    </html>
    

    相关文章

      网友评论

          本文标题:CSS 隐藏滚动条

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