Hide Scrollbars But Keep Functionality Code Example


Example 1: hide scrollbar css


/* Hide scrollbar for Chrome, Safari and Opera */
.scrollbar-hidden::-webkit-scrollbar {
display: none;
}

/* Hide scrollbar for IE, Edge add Firefox */
.scrollbar-hidden {
-ms-overflow-style: none;
scrollbar-width: none; /* Firefox */
}

Example 2: css hide scrollbar but allow scroll


html {
overflow: scroll;
}
::-webkit-scrollbar {
width: 0px;
background: transparent; /* make scrollbar transparent */
}

Example 3: hide scrollbars


//Hides scrollbars but does not allow scrolling
body
{
overflow-y: hidden; /* Hide vertical scrollbar */
overflow-x: hidden; /* Hide horizontal scrollbar */
}

//Hides scrollbars but keep the ability to scroll
/* Hide scrollbar for Chrome, Safari and Opera */
.example::-webkit-scrollbar {
display: none;
}

/* Hide scrollbar for IE, Edge and Firefox */
.example {
-ms-overflow-style: none; /* IE and Edge */
scrollbar-width: none; /* Firefox */
}

Example 4: hide scroll bar when not needed


overflow: auto;

Comments

Popular posts from this blog

Converting A String To Int In Groovy

"Cannot Create Cache Directory /home//.composer/cache/repo/https---packagist.org/, Or Directory Is Not Writable. Proceeding Without Cache"

Android SDK Location Should Not Contain Whitespace, As This Cause Problems With NDK Tools