Custom CSS Scrollbar for Firefox

后端 未结 10 2385
遥遥无期
遥遥无期 2020-11-22 02:23

I want to customize a scrollbar with CSS.

I use this WebKit CSS code, which works well for Safari and Chrome:

::-webkit-scrollbar {
    width: 15px;
         


        
10条回答
  •  旧巷少年郎
    2020-11-22 02:49

    It works in user-style, and it seems not to work in web pages. I have not found official direction from Mozilla on this. While it may have worked at some point, Firefox does not have official support for this. This bug is still open https://bugzilla.mozilla.org/show_bug.cgi?id=77790

    scrollbar {
    /*  clear useragent default style*/
       -moz-appearance: none !important;
    }
    /* buttons at two ends */
    scrollbarbutton {
       -moz-appearance: none !important;
    }
    /* the sliding part*/
    thumb{
       -moz-appearance: none !important;
    }
    scrollcorner {
       -moz-appearance: none !important;
       resize:both;
    }
    /* vertical or horizontal */
    scrollbar[orient="vertical"] {
        color:silver;
    }
    

    check http://codemug.com/html/custom-scrollbars-using-css/ for details.

提交回复
热议问题