CSS scrollbar style cross browser

This question already has an answer here:

  • CSS customized scroll bar in div 13 answers

  • Scrollbar CSS styles are an oddity invented by Microsoft developers. They are not part of the W3C standard for CSS and therefore most browsers just ignore them.


    Webkit's support for scrollbars is quite sophisticated. This CSS gives a very minimal scrollbar, with a light grey track and a darker thumb:

    ::-webkit-scrollbar
    {
      width: 12px;  /* for vertical scrollbars */
      height: 12px; /* for horizontal scrollbars */
    }
    
    ::-webkit-scrollbar-track
    {
      background: rgba(0, 0, 0, 0.1);
    }
    
    ::-webkit-scrollbar-thumb
    {
      background: rgba(0, 0, 0, 0.5);
    }
    

    This answer is a fantastic source of additional information.


    jScrollPane是一个很好的解决方案,可以跨浏览器滚动条并很好地降级。

    链接地址: http://www.djcxy.com/p/7164.html

    上一篇: 如何使用CSS设计<option>?

    下一篇: CSS滚动条样式跨浏览器