I have taken a horizontal scroll bar inside a div.
<div id="custom_scroll" style="width: 91%; overflow: auto; margin: 0 3%;">
<div id="custom_scroll_child" style="width: 100%">
</div>
</div>
I increase width of inner div#custom_scroll_child. But these scrollbar is not visible in mobile. So i want to include js library.
When i add any js library like mCustomScrollbar, It's scrollbar width and scroll left is not matching compared to default scroll bar.
So i want design of custom scrollbar. But want behaviour of native scrollbar.
So how can i achieve this? Please guide me.
try the following .
<style>
body {
margin: 0px;
padding: 0px;
color: black;
}
.custom_scroll {
width: 91%;
overflow: auto;
margin: 0 3%;
height: 200px;
border: 1px solid red;
}
.custom_scroll_child {width: 120%;}
/* Here you can easily customize it*/
body ::-webkit-scrollbar {-webkit-appearance: none;}
body ::-webkit-scrollbar:vertical {width: 12px;}
body ::-webkit-scrollbar:horizontal {height: 12px;}
body ::-webkit-scrollbar-thumb {
background-color: rgba(0, 0, 0, 0.5);
border-radius: 10px;
border: 2px solid #ff0;
}
body ::-webkit-scrollbar-track {
border-radius: 10px;
background-color: #f0f;
}
</style>
<div class="custom_scroll">
<div class="custom_scroll_child">
Lorem ipsum dolor sit amet consectetur adipisicing elit. At consectetur nam repudiandae odit illo minima dolorum nihil voluptatibus blanditiis recusandae culpa esse mollitia facere quasi, dignissimos, aperiam iure optio reiciendis?
</div>
</div>
here a jsfiddle
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With