How to make scrollbar overlapping page content

Deadly 提交于 2019-12-22 05:16:42

问题


I want to make scrollbar that overlaps the page. I wonder if there is a way to do it with pure CSS. I read an article about styling scrollbars with CSS (https://css-tricks.com/custom-scrollbars-in-webkit) but I didn't get a result I wanted. I think it would be possible to do it with some JavaScript and HTML element with fixed position, but I prefer to do it with CSS.


回答1:


You can try changing the background of the Scrollbar to transparent-

::-webkit-scrollbar-track {background: transparent}



回答2:


I have this same requirement in my project.

Here is the solution:

overflow: overlay

Hope it helps



来源:https://stackoverflow.com/questions/39253887/how-to-make-scrollbar-overlapping-page-content

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!