

We’ll use only 3 pseudo-element, webkit-scrollbar, webkit-scrollbar-track, and webkit-scrollbar-thumb in WebKit.
WEBKIT SCROLLBAR CSS CODE
Here we’ll provide short CSS code snippet to change the default scrollbar style and create a custom scrollbar with WebKit. Learn more about bidirectional Unicode characters. To review, open the file in an editor that reveals hidden Unicode characters. If scrollbar pseudo-element is defined, WebKit turns off the built-in scrollbar style and use the style provided in CSS under ::-webkit-scrollbar element. This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below.

WebKit allows you to styling scrollbars with your custom CSS. In this tutorial, we will show how you can make custom scrollbar and customize the look of the browser’s scrollbar with Webkit (pseudo element). And its color can be controlled by ::-webkit-scrollbar-corner. Using CSS pseudo-element, you can easily change the default scrollbar style with your custom style. The browser’s scrollbar can be customized using CSS. Custom scrollbars make the website feel and look different. I believe that this small trick will help you to make your website (or your child theme or whatever you are creating) more attractive.The web page UI design with custom scrollbar adds an extra value to your website. CSS Scrollbar: Webkit browsers like Chrome, Safari, and Opera, support the non-standard Webkit-scrollbar pseudo-element, which allows us to adjust the browser’s scrollbar. You can also set the width of the scrollbar, as well as choose border radius for both the scrollbar and its background. To briefly summarize it, you can choose the color of the scrollbar thumb, its track and its background color. ) Just check my Divi child theme mentioned above and you will see what each selector does. But if you check it in Chrome, you can see it.Īlso, you should always use a child theme and store your custom CSS code in its stylesheet file (style.css), not in your Divi Theme Options Custom CSS field.Įven if you’re not a CSS expert, you should be able to easily understand this code and customize it further, too. Instead, you can build your own stylesheet. jQuery does not have any methods that interact with pseudo-elements. ::webkit-scrollbar- are CSS selectors that select pseudo-elements.

For example, in Firefox it doesn’t work – you’ll see just the regular default scroll bar. css () method applies CSS properties to an element. However, the effect doesn’t work in all browsers. Fusce venenatis facilisis lectus ac semper. Nullam cursus suscipit nisi, et ultrices justo sodales nec. Sed et erat faucibus nunc euismod ultricies ut id justo. Curabitur venenatis pulvinar tellus gravida ornare. Ut dolor diam, elementum et vestibulum eu, porttitor vel elit. I did some customizations to it and I did it simply by using a few lines of custom CSS code. Fusce eget orci a orci congue vestibulum. If you check the demo of my first premium Divi child theme Blue Biz, you will see what I mean.

For example, it can have a different color and can be rounded. You may have noticed on some websites that it was customized.
WEBKIT SCROLLBAR CSS HOW TO
Just read on this article to find out how to do it.īy the scrollbar I mean the default vertical scrollbar that you can see even on the right side of this blog. Did you know that it is possible to change the look of the scroll bar of your website? It doesn’t have to look like the standard scrollbar on almost every website.
