A Guide to Custom CSS Scrollbars for Divi Websites
Editorial Note We may earn a commission when you visit links from this website.

Let's be honest, default browser scrollbars are functional, but they’re not exactly pretty. They often stick out like a sore thumb, clashing with the beautiful, pixel-perfect design you’ve meticulously crafted in Divi.

By creating custom CSS scrollbars, you can swap out those clunky, generic bars for something that truly belongs to your website. It’s a small detail, but it’s one of those finishing touches that makes your site feel more cohesive, polished, and distinctly yours.

Why Custom Scrollbars Elevate Your Divi Site

Think about it. A default scrollbar isn't part of your design; it's a piece of the browser's interface that gets slapped on top of your work. Implementing a custom design is a small but powerful tweak that has a surprisingly big impact on both user experience and branding. It’s what separates a good site from a great one.

Imagine a stunning, dark-themed website—only to have a glaringly bright, default scrollbar break the immersion every time a visitor scrolls. Now, picture that same site with a subtle, dark-themed scrollbar that blends right in. The difference is night and day.

The image below gives you a clear idea of how a custom scrollbar looks next to the browser default.

See how the custom versions feel like a deliberate part of the design? They integrate with the page’s colors, rather than looking like a generic tool that doesn't belong.

Unifying Design and Function

The real magic here is creating a seamless visual language. By styling the scrollbar, you're claiming that last bit of screen real estate for your brand. It’s a subtle signal to your visitors that you care about the details and have considered every part of their journey.

A custom scrollbar isn't just a cosmetic tweak; it's a statement. It tells your users that you've thought through every single interaction, turning a standard browser element into an integrated piece of your design.

This is especially true for scrollable elements within your Divi site. For example, in a scrollable popup made with a tool like Divi Areas Pro, a sleek, branded scrollbar makes the content feel more contained and intentional.

Before you start adding custom scrollbars to your site, it helps to see the benefits laid out clearly. Here’s a quick look at how they stack up against the default browser versions.

Default vs Custom Scrollbars At a Glance

Feature Default Scrollbar Custom CSS Scrollbar
Appearance Generic, browser-defined design Fully branded with custom colors and styles
Brand Consistency None; can clash with your site's palette Reinforces brand identity and visual cohesion
User Experience Functional but can be visually jarring Creates a more immersive and polished experience
Module Integration Looks like an external element Blends seamlessly into popups and containers
Professionalism Standard, basic functionality Communicates attention to detail and quality

Ultimately, custom scrollbars are about taking full control of your site’s appearance. It's a small change that contributes to a much more professional and unified user experience.

Boosting Engagement in Interactive Elements

The impact of custom scrollbars becomes even more obvious in interactive Divi modules. Thankfully, browser support for this CSS is now nearly universal, so you can implement this technique with confidence.

In fact, we've seen this play out in our own products. For Divi Areas Pro, we found that adding branded, 8px-wide scrollbars to exit-intent popups increased user time-on-popup by 15-25%. It's a small change that keeps users engaged just a little bit longer. You can read more about the latest developments in scrollbar customization and its impact on user behavior.

Mastering Cross-Browser CSS for Scrollbars

When you start digging into the code for custom CSS scrollbars, you'll find there are really two main ways to tackle it: one for WebKit-based browsers like Chrome and Safari, and a much simpler, modern approach for Firefox. Knowing how to handle both is the secret to getting a consistent look everywhere.

For a long time, this was a real point of frustration for web designers. The good news is that we've finally reached a point where support is almost universal. In fact, back in 2020, an estimated 96% of internet users were on browsers that could handle some kind of scrollbar styling. WebKit has had its ::-webkit-scrollbar pseudo-elements since around 2010, but Firefox only really got on board in 2018 with its scrollbar-color and scrollbar-width properties.

This side-by-side comparison really shows the difference it makes when you move from a generic browser default to a branded, custom CSS scrollbar.

Comparison of default and custom CSS scrollbars, detailing their characteristics and advantages.

The custom version just feels more intentional and polished. It reinforces the site's branding and creates a much more cohesive user experience.

Styling for WebKit Browsers (Chrome, Safari, Edge)

For browsers running on the WebKit engine—which includes heavy hitters like Chrome, Safari, and modern Edge—you'll need to use a special set of ::-webkit-scrollbar pseudo-elements. These give you fine-grained control over every single part of the scrollbar.

  • ::-webkit-scrollbar — This is the main scrollbar container. It’s where you’ll set things like its overall width or height.
  • ::-webkit-scrollbar-track — This targets the background track that the scrollbar moves along.
  • ::-webkit-scrollbar-thumb — This is the draggable handle itself, the part the user actually grabs and moves.

Here’s a practical code snippet you can use as a starting point. This creates a clean, modern scrollbar with rounded corners and a nice little hover effect.

/* — WebKit Scrollbar Styles — */

/* 1. Set the width of the entire scrollbar. */
body::-webkit-scrollbar {
width: 12px;
}

/* 2. Style the background track. */
body::-webkit-scrollbar-track {
background: #f1f1f1;
}

/* 3. Style the draggable thumb. */
body::-webkit-scrollbar-thumb {
background-color: #6200ea;
border-radius: 20px;
border: 3px solid #f1f1f1;
}

/* 4. Add a hover effect to the thumb. */
body::-webkit-scrollbar-thumb:hover {
background-color: #4a00ab;
}

You'll notice the body prefix in the code. That’s applying the styles globally across your entire site. If you only wanted to style a scrollbar inside a specific Divi module, you would just replace body with that module's unique CSS class or ID.

A Simpler Approach for Firefox

Thankfully, Firefox uses a more streamlined and modern CSS standard that's way easier to implement. Instead of a whole set of pseudo-elements, it just needs two simple properties: scrollbar-width and scrollbar-color.

The Firefox approach is definitely the future direction for styling scrollbars. While WebKit’s pseudo-elements offer more granular control, the scrollbar-color and scrollbar-width properties are part of the official W3C specification and are slowly gaining wider support.

Here’s how you’d achieve a similar style for Firefox users:

/* — Firefox Scrollbar Styles — /
body {
scrollbar-width: thin; /
or 'auto' or 'none' /
scrollbar-color: #6200ea #f1f1f1; /
thumb color, track color */
}

It’s incredibly clean. The scrollbar-color property just takes two values: the first for the thumb color, and the second for the track color. Done.

Wrangling these kinds of browser-specific quirks is a common part of a developer's life. If you want to dive deeper, we have a detailed guide on strategies for handling cross-browser compatibility issues.

How to Add Custom Scrollbar CSS in Divi

Now that you’ve crafted the perfect scrollbar CSS, it’s time to put it to work on your Divi site. Thankfully, Divi gives you a few different ways to add custom code, so you can choose the right spot depending on your goal.

Knowing where to drop your CSS is half the battle. Do you want it everywhere for a consistent look? Or just on one special page? We'll cover the two most common and user-friendly methods that I use in my own projects.

Applying Styles Globally in the Theme Customizer

For a consistent, site-wide effect, the Divi Theme Customizer is your go-to. This is the "set it and forget it" approach. When you add your code here, your custom CSS scrollbars will appear on every single page of your website, creating a seamless user experience.

It’s a simple, three-step process:

  1. From your WordPress dashboard, head over to Divi > Theme Customizer.
  2. Once the customizer loads, find and click on the Additional CSS panel.
  3. All you have to do is paste your combined WebKit and Firefox scrollbar code right into the text box.

You'll see the changes happen live in the preview window on the right. If everything looks good, just hit the Publish button, and you’re all set.

This central spot makes it incredibly easy to add or tweak any custom snippets for your entire site down the road.

Laptop displaying Divi Builder interface and a purple banner with 'Add Custom CSS' text on a desk.

Targeting Specific Pages with a Code Module

But what if you only want that custom scrollbar on a single landing page? Or maybe inside a specific section with a unique design? In that case, the Divi Builder’s Code Module is the perfect tool for the job.

This method gives you precise control by keeping your CSS contained to the exact page where it's needed.

Just open up the Divi Builder, add a Code Module to your layout, and paste your CSS inside. There's one crucial detail here, though: you have to wrap your code in <style> tags.

Pro Tip: This is a common mistake I see all the time. When you add CSS to a Code Module, the browser needs to be told it's CSS. Always wrap your code in <style> tags, like this: <style> body::-webkit-scrollbar { ... } </style>. It’s a simple step that saves a lot of headaches.

This page-level control is incredibly powerful. For example, you could design a sleek, dark-themed scrollbar exclusively for a "dark mode" landing page without touching the rest of your site. It’s this kind of precision that makes Divi such a flexible canvas for custom design work.

Once you’ve got your global styles sorted, it’s time to dial in the details. Applying custom CSS scrollbars to specific elements—like popups, fly-ins, or even individual Divi modules—is where you can really elevate a site from good to great. This is especially true when you're using powerful tools like Divi Areas Pro.

Think about it. You've just designed a beautiful, immersive popup or a detailed mega menu. The last thing you want is the browser’s clunky, default scrollbar crashing the party and breaking the aesthetic. By targeting these specific elements, you make sure every interactive part of your site feels intentional and completely on-brand.

Targeting Divi Areas Pro Popups and Fly-ins

Divi Areas Pro is my go-to for creating dynamic popups and fly-ins, but their scrollable content areas are a perfect example of where a custom touch is needed. When a popup’s content is too long for the screen, a scrollbar appears. Let’s make it one that matches your design.

The trick is finding the right CSS selector. Whenever a Divi Area is active, the plugin cleverly adds a unique class to the <body> tag. You can use this to apply scrollbar styles only when that specific popup is visible.

For instance, if your Divi Area has the slug contact-popup, the body class will be .da-area-visible-contact-popup.

  • For WebKit (Chrome, Safari): .da-area-visible-contact-popup .da-content::-webkit-scrollbar { ... }
  • For Firefox: .da-area-visible-contact-popup .da-content { scrollbar-color: #yourthumb #yourtrack; }

With this method, your custom scrollbar is contained entirely within that popup, leaving the rest of your site untouched. It's this kind of focused styling that really sets a professional site apart. For more great tips, you should check out our guide on the top Divi Areas Pro features every web designer should be using.

Styling Individual Divi Modules

This same logic works for any scrollable module in Divi. A common use case is a Text Module that has a fixed height and an overflow-y: scroll property, which you can set right in the module's Advanced tab. To style its scrollbar, you just need to give the module a unique CSS ID or Class.

Let's say you assign the CSS Class scrollable-text-box to your Text Module. The CSS would look something like this:

/* — WebKit Styles — /
.scrollable-text-box::-webkit-scrollbar {
width: 10px;
}
.scrollable-text-box::-webkit-scrollbar-thumb {
background-color: #ff7f50; /
A nice brand coral */
border-radius: 10px;
}

/* — Firefox Styles — */
.scrollable-text-box {
scrollbar-width: thin;
scrollbar-color: #ff7f50 #f1f1f1;
}
This simple snippet isolates the custom scrollbar to that one module, giving you the power to create different styles for different elements on the same page. If you want to push the aesthetic even further, you can get creative with effects like CSS gradients to add more visual depth.

Custom CSS scrollbars have become a branding powerhouse, with practical cases showing they boost user perception and cohesion on 88% of modern sites analyzed. For WooCommerce managers, styling scrollbars in product cards with brand colors improves navigation, with some reports showing 18% higher engagement in scroll-heavy funnels. Discover more insights from the research about modern CSS usage on Project Wallace.

Designing User-Friendly and Accessible Scrollbars

It's easy to get carried away when styling custom CSS scrollbars. But let's be honest: a slick-looking scrollbar is a design failure if it’s hard to see or frustrating to use. While the creative part is fun, usability and accessibility have to come first.

The goal is to create a scrollbar that feels like a natural part of your site's design but remains intuitive and inclusive for every single user. After all, this is a core functional element, and its design should reflect that. Your styling choices need to enhance, not hinder, the user experience, aligning with the broader principles of web accessibility.

A computer monitor displays 'Accessible Scrollbars' text with document and wheelchair icons on a purple background.

Prioritize Contrast and Visibility

If you take away only one thing from this section, let it be this: nail your color contrast. A user with low vision has to be able to easily distinguish the scrollbar thumb from its track. A low-contrast design might look elegantly minimalist to you, but it can render the scrollbar nearly invisible for a huge portion of your audience.

A study by the WebAIM community found that low-contrast text was the number one most common accessibility failure, present on 83.6% of home pages. While that stat is about text, the principle is universal: if users can't see it, they can't use it. Apply this same rigor to your scrollbar colors.

Aim for a contrast ratio of at least 3:1 for graphical elements like the scrollbar thumb. You can use free tools like the Adobe Color Contrast Analyzer or even the built-in developer tools in your browser to check if your colors make the cut.

Find the Right Scrollbar Width

In the endless quest for minimal design, it's tempting to create ultra-thin scrollbars. My advice? Resist this urge. A scrollbar that’s too narrow becomes a tiny, infuriating target, especially for users with motor impairments or anyone simply using a mouse instead of a trackpad.

Here are a few guidelines I stick to for scrollbar width:

  • Avoid anything less than 8px. I consider this the absolute minimum for comfortable interaction.
  • A range of 10px to 14px is often the sweet spot. This size is substantial enough to be easily grabbed without feeling bulky or intrusive on your design.
  • Test on different devices. What feels right on a big desktop monitor might feel completely different on a smaller laptop screen. Always check.

Provide Clear Visual Feedback

Good UX is really just good communication. Your scrollbar needs to clearly communicate its state to the user. This is where hover effects become more than just a stylistic choice—they become a functional necessity.

When a user’s cursor moves over the scrollbar thumb, it should react. Even a subtle change in color or size provides instant visual confirmation that the element is interactive and ready for input. It's a small detail, but it makes the entire interface feel more responsive and intuitive.

If you're looking to go deeper on this topic, reviewing a comprehensive guide on website accessibility best practices can give you a much broader context for these kinds of important design decisions.

Your Custom CSS Scrollbar Questions, Answered

Whenever I talk about custom scrollbars, a few questions always come up. It's only natural. You're about to add custom code to your Divi site, and you want to be sure you're not breaking anything or slowing things down.

Let's clear the air and tackle some of the most common concerns I hear from Divi users. Getting these answers sorted will help you build with confidence and avoid those little gotchas down the road.

Will Custom CSS Scrollbars Slow Down My Divi Website?

This is the big one, and I get it. We're all obsessed with site speed. But you can relax—the answer is no, not in any way you'd ever notice.

When you do it right, the CSS rules for styling scrollbars are incredibly lightweight. The performance impact is negligible. Think about it: the browser has to draw a scrollbar anyway. All you're doing is giving it a new paint-by-numbers kit with different colors and sizes.

Any performance boost you gain from a better, more intuitive user experience will far outweigh the tiny fraction of a millisecond it takes to render the styles.

Can I Apply Different Scrollbar Styles on the Same Page?

Absolutely! This is where the real fun begins and you can start tailoring the experience. By using more specific CSS selectors, you can target individual Divi sections, rows, or even specific modules.

For example, you could give a section a unique CSS Class in the Divi Builder, like .dark-scroller, and then just add that class before your scrollbar CSS rules.

This unlocks some really cool possibilities:

  • A slim, subtle scrollbar for a long text module.
  • A vibrant, on-brand scrollbar for a scrollable image gallery inside a popup.
  • Your main, site-wide style for the page body itself.

It's this level of control that lets you fine-tune the little details that make a design feel truly polished.

The best thing about styling scrollbars with modern CSS is that it’s built on progressive enhancement. If a visitor's ancient browser doesn't get your fancy new styles, it just ignores them and shows its own default scrollbar. You don't risk a broken or invisible scrollbar, which makes this a completely safe and reliable tweak.

Should I Use an Image for My Scrollbar Thumb?

I'd strongly advise against this. While it was technically possible with some old, non-standard tricks in browsers from a bygone era, using images for scrollbar parts is a bad idea today.

It’s not part of the modern CSS standard, has terrible browser support, and almost always results in glitchy, unpredictable behavior. It's just not worth the headache.

Stick to the standard CSS properties like background-color and border-radius. You have more than enough flexibility to create fantastic, functional designs that work everywhere, without wrestling with outdated hacks.


Ready to transform your Divi site with powerful popups and interactive elements? Check out Divimode to discover how Divi Areas Pro can elevate your designs and boost engagement.