Skip to content Skip to sidebar Skip to footer

Scroll Content Without Scrollbar Using Css

I am trying to scroll a content child of a fixed div. I am trying to scroll without the scroll bar being visible (using the mouse scroll). I have pretty much tried all the solution

Solution 1:

You could kinda hack it cross-browser by expanding the width of the nav element and force scrollbars. Updated JSFiddle.

nav {
    position:relative;
    height:100%;
    width: 110%;         /*  <----   */overflow-x:hidden;
    overflow-y:scroll;   /*  <----   */
}

Of course, you'll want to adjust the percentage to your needs or use calc( 100% + 15px ).

Solution 2:

You can try the following :

#left-panel {
    position:fixed;
    height:100%;
    top:0px;
    left:0px;
    border:1px solid red;
    width:220px;
    overflow:hidden;
}

nav {
   height:100%;
   overflow-y:auto;
   overflow-x:hidden;
   width:100%;
   padding-right: 15px;      
}

Example

Solution 3:

You can style the scrollbar using webkit.

element::-webkit-scrollbar {styling here}

In order to hide the scroll bar on your nav element you can use the following:

nav::-webkit-scrollbar {
    width:0!important;
}

Post a Comment for "Scroll Content Without Scrollbar Using Css"