0

Here is current scrollbar I working on.

Scrollbar Image

//The overflow div
div {
width: 100%;
overflow: overlay;
}

//Scroll Bar CSS
::-webkit-scrollbar{width:14px;}

::-webkit-scrollbar-thumb {background: #4b49499c;border-radius: 50px;}

::-webkit-scrollbar-track {background: transparent;}

I want to make the scrollbar have some spacing/padding/margin on right site, instead of scrollbar fully attached to the end of right. I tried to reduce the div width size. this does work for creating some right space for the scrollbar, but the children div inside it the width is reduce together.

After Reducing the width of div Image

   //The overflow div
    div {
    width: 96%;
    overflow: overlay;
    }
    
    //Scroll Bar CSS
    ::-webkit-scrollbar{width:14px;}
    
    ::-webkit-scrollbar-thumb {background: #4b49499c;border-radius: 50px;}
    
    ::-webkit-scrollbar-track {background: transparent;}

And here is the sample result that I want.

Expected Result

Anyone have idea on how to make this happen?

Gerard Haw
  • 86
  • 6

0 Answers0