Scrollbar color change in Firefox

后端 未结 8 887
迷失自我
迷失自我 2020-11-30 07:21

I want to change the scrollbar color in Firefox. How can I do that?

相关标签:
8条回答
  • 2020-11-30 08:18

    Chrome and Safari do support the coloring of the scrollbars. Place the following code in your css and see the magic happen:

    ::-webkit-scrollbar {
      height: 12px;
      width: 12px;
      background: #969696;
      -webkit-border-radius: 1ex;
    }
    
    ::-webkit-scrollbar-thumb {
      background: #2B2B2B;
      -webkit-border-radius: 1ex;
      -webkit-box-shadow: 0px 1px 2px rgba(0, 0, 0, 0.75);
    }
    
    ::-webkit-scrollbar-corner {
      background: #1A1A1A;
    }
    

    The only thing missing is for firefox to support this feature.

    0 讨论(0)
  • 2020-11-30 08:21

    This is not really useful as far as I know, but it's worth noting that the attribute which controls whether or not scrollbars are displayed in Firefox is: (reference link)

    Attribute....scrollbars
    Type.........nsIDOMBarProp
    Description..The object that controls whether or not scrollbars 
                 are shown in the window. This attribute is "replaceable" 
                 in JavaScript. Read only
    

    Firefox also has the following vendor specific properties:

    overflow: -moz-scrollbars-none

    other valid values are -moz-scrollbars-horizontal and -moz-scrollbars-vertical.

    0 讨论(0)
提交回复
热议问题