Customization scroll bar

Asked

Viewed 191 times

4

Today, can we use CSS only to change the customization of the scrollbar of a DIV? If yes, how can I do it. Otherwise which script is best and how to use it?

2 answers

4


Define styles for scrollbar is a rarity, they are not part of the W3C standard for css, and therefore, most browsers simply ignore.

But there are Webkits that allow customization, in my tests I could not find one that had support to all current browsers.

Custom Scrollbars in Webkit

In the link above has an example, the same will work in Google Chrome, but in other as Firefox and IE will not take effect.

I searched the W3C and found the following:

Currently, there is no form of scroll customization compatible with all browsers. Article W3C Mentions at the end the following statement on Friday 7 August 2015 18:50:04:

Some browsers (IE,konqueror) support properties that are not part of the default like scrollbar-shadow-color, scrollbar-track-color and others. These properties are illegal, they are not defined in any specification CSS nor are they identified as propriétárias (prefixing them with "-vendor-").

W3C Scrollbars Test

On this topic in Stackoverflow and addressed this issue and one of the most assertive approaches and use a plugin, some of them:

iScroll

nanoScrollerJS

  • 3

    Gabriel, you gave exactly the same answer that in another question. I think it would be a case of marking the question as duplicate or adapting the answer to be more exact to the AP problem.

  • @Sergio the scrollbar works the same way on div so it would be better to mark it as duplicate even.

3

Browser other questions tagged

You are not signed in. Login or sign up in order to post.