mrtechhive title BG

Add Custom Scrollbar in WordPress Using Custom CSS | Step-by-Step Guide [2023]

Why Use Custom Scrollbar in WordPress Website?

WordPress is one of the most popular content management systems for building websites. One of the many advantages of using WordPress is the ability to customize the design and functionality of your website to meet your needs. If you’re looking to enhance the visual appeal of your website and provide a better user experience to your visitors, one way to do that is by adding a scrollbar in WordPress using custom CSS. In this article, we’ll show you how to add a custom scrollbar in WordPress website using custom CSS in just a few easy steps.

Before we get into the step-by-step guide, let’s briefly discuss the benefits of using a custom scrollbar in your WordPress website. A scrollbar can help improve your website’s overall look and feel and provide a better user experience for your visitors. It can also be used to match the website’s color scheme or design, making it a seamless addition to the website.

Step-by-Step Guide to Add Scrollbar on WordPress Website Using Custom CSS
  • Accessing WordPress Dashboard To get started, log in to your WordPress website and navigate to the dashboard. From there, you can access the theme customizer or a plugin to add custom CSS to your website.
  • Adding Custom CSS to WordPress Website. Once in the dashboard, you can add custom CSS to your website using the theme customizer or a plugin. If you’re using the theme customizer, navigate to Appearance > Customize > Additional CSS. If you’re using a plugin, install and activate it, then navigate to the plugin settings and add your custom CSS code.
  • Adding Scrollbar CSS Code. To add a scrollbar, you’ll need to add the following code to your website.

Install Free Plugin

Custom CSS & Custom JS Plugins to install Plugins Click Add New and Install then Activate./

Custom Scrollbar in WordPress

Custom Scroll Bar CSS


::-webkit-scrollbar{
    width: 0.7vw;
    background: 46464600;
}
::-webkit-scrollbar-thumb{
    background: -webkit-linear-gradient(transparent,#ea6a40);
    background: linear-gradient(transparent,#ea6a40);
    border-radius: 20px;
}

Read more: Automatically delete WooCommerce website images after products are deleted to improve performance.

Custom Scroll Bar Hover CSS

/***Hover CSS***/
::-webkit-scrollbar-thumb:hover{
   background: -webkit-linear-gradient(transparent,#464646);
   background: linear-gradient(transparent,#464646); 
}
/***End***/

This CSS code will create a scrollbar with a width of 0.7vw and a background color of #46464600. The thumb of the scrollbar will have a gradient background color of transparent and #ea6a40 and a border radius of 20px. The hover effect will change the background color of the thumb to transparent and #464646.

Preview and Save Changes
Once you’ve added the scrollbar CSS code, you can preview it on your website before saving the changes. If you’re using the theme customizer, click on the “Publish” button to save the changes. If you’re using a plugin, click on the “Save Changes” button to save the changes.

Conclusion

Adding a scrollbar using custom CSS is a great way to enhance the visual appeal of your WordPress website and provide a better user experience to your visitors. With the step-by-step guide provided in this article, you should be able to add Customizing your WordPress website is an ongoing process that requires time, effort, and creativity. Adding a scrollbar using custom CSS is just one way to enhance the visual appeal of your website and provide a better user experience to your visitors.

This custom scrollbar Mozilla firefox and internet explorer will not support these two browsers. These two browsers show the default scrollbar when a visitor visits your website.

We hope this article has helped you learn how to add a scrollbar on WordPress using custom CSS. If you have any questions or comments, please feel free to leave them below, and we will get back to you as soon as possible.

Happy customizing!

Leave a Reply

Your email address will not be published. Required fields are marked *