Do you want to make your website look unique? Adding a custom scrollbar can help. It is simple and fun. This guide will show you how to add a custom scrollbar to any element in WordPress.
What is a Custom Scrollbar?
A scrollbar helps you move up and down on a webpage. A custom scrollbar is one that you design yourself. It can match your website’s style. This makes your site look better.
Why Use a Custom Scrollbar?
Custom scrollbars make your site unique. They can match your site’s colors and themes. This makes your site look more professional. Your visitors will like it.

Credit: neuronthemes.com
Steps to Add a Custom Scrollbar
Follow these simple steps to add a custom scrollbar. You do not need to be an expert. Even beginners can do this.
Step 1: Open Your WordPress Dashboard
First, log in to your WordPress dashboard. This is where you manage your site.
Step 2: Go To Appearance
In the left menu, find “Appearance.” Click on it. Then click “Customize.” This will open the customizer.
Step 3: Add Custom Css
In the customizer, find “Additional CSS.” Click on it. This is where you will add your custom CSS code.
Step 4: Write Your Css Code
Now, you need to write some CSS code. This will create your custom scrollbar. Here is a simple example:
/ Style for the scrollbar track /
::-webkit-scrollbar {
width: 12px;
}
/ Style for the scrollbar thumb /
::-webkit-scrollbar-thumb {
background-color: #8e44ad;
border-radius: 10px;
}
/ Style for the scrollbar thumb when hovered /
::-webkit-scrollbar-thumb:hover {
background-color: #732d91;
}
/ Style for the scrollbar track /
::-webkit-scrollbar-track {
background-color: #ecf0f1;
}
Copy and paste this code into the “Additional CSS” box. You can change the colors to match your site.
Step 5: Save Your Changes
After adding the code, click “Publish.” This will save your changes. Now, your site will have a custom scrollbar.
Adding Custom Scrollbar to Specific Element
Sometimes, you may want a custom scrollbar for a specific element. Here is how you can do that.
Step 1: Identify The Element
First, find the element you want to style. It could be a div, a section, or any other HTML element.
Step 2: Add Custom Css For The Element
In your “Additional CSS” box, add the following code:
/ Style for the specific element's scrollbar /
.your-element-class::-webkit-scrollbar {
width: 12px;
}
.your-element-class::-webkit-scrollbar-thumb {
background-color: #8e44ad;
border-radius: 10px;
}
.your-element-class::-webkit-scrollbar-thumb:hover {
background-color: #732d91;
}
.your-element-class::-webkit-scrollbar-track {
background-color: #ecf0f1;
}
Replace “.your-element-class” with the actual class or ID of your element. This will style the scrollbar for that element only.
Step 3: Save Your Changes
Click “Publish” to save your changes. Now, the specific element will have a custom scrollbar.
Tips for Designing Custom Scrollbars
Here are some tips to help you design better custom scrollbars:
- Keep it Simple: Do not use too many colors. Simple designs look better.
- Match Your Site: Make sure the scrollbar matches your site’s colors and theme.
- Test on Different Devices: Check how the scrollbar looks on different devices. It should look good on both desktop and mobile.

Credit: www.wpbeginner.com
Common Issues and How to Fix Them
Sometimes, you may face issues when adding a custom scrollbar. Here are some common problems and how to fix them:
Scrollbar Not Showing
If the scrollbar is not showing, check your CSS code. Make sure there are no errors. Also, check if the element is scrollable.
Scrollbar Looks Different On Different Browsers
Different browsers may display scrollbars differently. Test your site on different browsers. Adjust your CSS code if needed.
Scrollbar Not Matching The Site
If the scrollbar does not match your site, change the colors. Use colors that match your site’s theme.
Frequently Asked Questions
How To Add Custom Scrollbar In WordPress?
To add a custom scrollbar, use CSS and modify your theme’s style file.
Can I Use Plugins For Custom Scrollbars?
Yes, plugins like “Advanced Scrollbar” can help you add custom scrollbars.
Is Coding Required For Custom Scrollbars?
Some coding knowledge is helpful. But plugins can make it easier.
Are Custom Scrollbars Mobile-friendly?
Yes, with proper CSS, custom scrollbars can be mobile-friendly.
Conclusion
Adding a custom scrollbar to your WordPress site is easy. It makes your site look unique and professional. Follow the steps in this guide to add a custom scrollbar. Experiment with different designs. Have fun!
We hope this guide helps you. Enjoy making your site look great!