Custom Scrollbar using CSS
Posted By : Gaurav Arora | 09-Jan-2017
Hi, In this blog we are going to create custom scroll bar, as the normal one’s looks a bit old. So, we can give use them with new User Interface with the help of css.
First we will start by including our HTML part
Lorem Ipsum is simply dummy text of the printing and typesetting industry.
Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.
It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged.
It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
After that we will include some css
::-webkit-scrollbar { width: 5px; background: #ccc; } ::-webkit-scrollbar-track { background: #ccc; border-radius: 2px; } ::-webkit-scrollbar-thumb { background: #f0f0f0; border-radius: 2px; }
As I'm using this as a whole body's scrollbar, you can also use this custom scrollbar on a particular div, just by adding that class name using parent structure.
This custom scrollbar will only work in webkit based browsers.
In this way we can create a custom scrollbar using css.
Cookies are important to the proper functioning of a site. To improve your experience, we use cookies to remember log-in details and provide secure log-in, collect statistics to optimize site functionality, and deliver content tailored to your interests. Click Agree and Proceed to accept cookies and go directly to the site or click on View Cookie Settings to see detailed descriptions of the types of cookies and choose whether to accept certain cookies while on the site.
About Author
Gaurav Arora
Gaurav is an experienced UI developer with experience and capabilities to build compelling UI's for Web and Mobile Applications.