Custom Scrollbar using CSS

Posted By : Gaurav Arora | 09-Jan-2017

Custom Scrollbar CSS

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.

About Author

Author Image
Gaurav Arora

Gaurav is an experienced UI developer with experience and capabilities to build compelling UI's for Web and Mobile Applications.

Request for Proposal

Name is required

Comment is required

Sending message..