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

530 Valid Hostname Is Expected When Setting Up IIS 10 For Multiple Sites

C Perror Example

Converting A String To Int In Groovy