Css Overflow Hidden No Scrollbar 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: hide the scrollbar in css if not overflow


.myClass {
/*auto will remove and add the scroll bar as needed*/
overflow: auto;
}

Example 3: javascript hide scrollbar


function HideScrollbar() {
var style = document.createElement("style");
style.innerHTML = `body::-webkit-scrollbar
{display: none;}`;
document.head.appendChild(style);
}

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 How Can I Convert A String To A Editable