【问题标题】:i want to Apply Border-Radius To Scrollbars with CSS我想用 CSS 将 Border-Radius 应用于滚动条
【发布时间】:2022-01-23 17:54:34
【问题描述】:

我有一个带有此滚动条的 div see the image here

但我想要这种类型的滚动用于我的 div see the image here

【问题讨论】:

    标签: scroll radius


    【解决方案1】:

    我不确定是否所有网络浏览器的反应方式都相同,但您可以试试这个:

    <style>
    /* width */
    ::-webkit-scrollbar {
      width: 20px;
    }
    
    /* Track */
    ::-webkit-scrollbar-track {
      box-shadow: inset 0 0 5px grey; 
      border-radius: 10px;
    }
     
    /* Handle */
    ::-webkit-scrollbar-thumb {
      background: red; 
      border-radius: 10px;
    }
    
    /* Handle on hover */
    ::-webkit-scrollbar-thumb:hover {
      background: #b30000; 
    }
    </style>
    

    来源:https://www.w3schools.com/howto/tryit.asp?filename=tryhow_css_custom_scrollbar2

    【讨论】:

    【解决方案2】:

    【讨论】:

      猜你喜欢
      • 2013-05-16
      • 2012-03-05
      • 2020-05-12
      • 1970-01-01
      • 2011-04-27
      • 2020-08-03
      • 2022-01-25
      • 2015-12-02
      相关资源
      最近更新 更多