Apply Border-Radius To Scrollbars with CSS

前端 未结 5 593
闹比i
闹比i 2020-12-15 04:02

To put it simple, this is what i want (obtained on a Webkit Browser using -webkit-scrollbar) :

An

5条回答
  •  执笔经年
    2020-12-15 04:49

    I've been having the same issue. It's not the most elegant of solutions but, simply put a smaller div inside your outer box so the scroll bar doesn't overlap the outer box.

    Like this code copied from this pen:

    .box {
      height: 200px;
      width: 250px;
      border-radius: 10px;
      border: 2px solid #666;
      padding: 6px 0px;
      background: #ccc;
    }
    
    .box-content {
      height: 200px;
      width: 250px;
      overflow: auto;
      border-radius: 8px;
    }
    1. test
    2. test
    3. test
    4. test
    5. test
    6. test
    7. test
    8. test
    9. test
    10. test
    11. test
    12. test
    13. test
    14. test
    15. test
    16. test

提交回复
热议问题