overflow scroll but hide scrollbar code example
Example 1: hide scrollbar css
.scrollbar-hidden::-webkit-scrollbar {
display: none;
}
.scrollbar-hidden {
-ms-overflow-style: none;
scrollbar-width: none;
}
Example 2: css hide scrollbar but allow scroll
html {
overflow: scroll;
}
::-webkit-scrollbar {
width: 0px;
background: transparent;
}
Example 3: hide scrollbars
//Hides scrollbars but does not allow scrolling
body {
overflow-y: hidden;
overflow-x: hidden;
}
//Hides scrollbars but keep the ability to scroll
.example::-webkit-scrollbar {
display: none;
}
.example {
-ms-overflow-style: none;
scrollbar-width: none;
}
Example 4: css hide scrollbar
// Sass Mixing
@mixin hideScrollbar {
&::-webkit-scrollbar {
width: 0 !important
}
-ms-overflow-style: none;
scrollbar-width: none;
}
Example 5: hide the scrollbar in css if not overflow
.myClass {
overflow: auto;
}