How do you make a custom scroll bar?

2019-08-31 12:50发布

问题:

Can anyone give a thorough explanation of how to make custom scroll bars? Are custom scroll bars compatible with all browsers?

回答1:

You need to use pure javaScript to become compatible with all browsers.

This is one of the best solution for that

http://www.script-tutorials.com/custom-scrollbars-cross-browser-solution/



回答2:

These were one search away, and they're really good:

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

http://www.hongkiat.com/blog/css-scroll-bar/

http://www.codeproject.com/Tips/674478/Customize-Scrollbars-using-CSS3



回答3:

::-webkit-scrollbar-track {
      background-color: #eaeaea;
      border-left: 1px solid #ccc;
}

Simply add the above.