Custom CSS Scrollbar for Firefox

后端 未结 10 2529
遥遥无期
遥遥无期 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:48

    As of late 2018, there is now limited customization available in Firefox!

    See these answers:

    • https://stackoverflow.com/a/54101063/405015
    • https://stackoverflow.com/a/53739309/405015

    And this for background info: https://bugzilla.mozilla.org/show_bug.cgi?id=1460109


    There's no Firefox equivalent to ::-webkit-scrollbar and friends.

    You'll have to stick with JavaScript.

    Plenty of people would like this feature, see: https://bugzilla.mozilla.org/show_bug.cgi?id=77790


    As far as JavaScript replacements go, you can try:

    • https://github.com/mdbootstrap/perfect-scrollbar
    • https://github.com/Grsmto/simplebar
    • https://github.com/vitch/jScrollPane

提交回复
热议问题