How to override “::-webkit-scrollbar” CSS rule and

2019-02-04 03:10发布

I use the following rule to make scrollbars invisible:

::-webkit-scrollbar { display: none; }

How do I override this rule to make scrollbars visible again? I tried the following:

::-webkit-scrollbar { display: initial; }

In this case scrollbars reserve their space, but the thumb is not visible.

See a short demo here.

1条回答
2楼-- · 2019-02-04 04:09

try

::-webkit-scrollbar { visibility: hidden; }

and

::-webkit-scrollbar { visibility: visible; }

Edit:

Though, that would keep the space... So, add "width: 0 !important;"

查看更多
登录 后发表回答