In This Article:
Customizing the scrollbar adds a unique touch to your website's design. With the CSS provided, you can change the scrollbar’s color, size, and even its hover effects. By following this guide, you’ll learn how to apply this code to your Duda website and personalize it to match your brand.
Below is the code snippet we’ll be using. Each part of the code is explained in detail to help you make adjustments:
/* WEBSITE SCROLL BAR CSS */
::-webkit-scrollbar {
width: 15px;
}
::-webkit-scrollbar-track {
box-shadow: inset 0 0 10px #eeeeee;
border-radius: 5px;
}
::-webkit-scrollbar-thumb {
background: #23a0a3;
border-radius: 5px;
}
::-webkit-scrollbar-thumb:hover {
background: #1b7d7e;
}
::-webkit-scrollbar
: This targets the scrollbar itself and allows us to set its width. Here, we set the
width
to
15px
. You can adjust this to make the scrollbar narrower or wider, depending on your design preference.::-webkit-scrollbar-track
: This defines the track of the scrollbar—the area in which the scrollbar thumb moves. We use the
box-shadow
property to add a subtle inner shadow effect (
inset 0 0 10px #eeeeee
), giving it a more defined, styled appearance. The
border-radius
of
5px
rounds the corners of the scrollbar track. Adjusting the radius here will make it more or less rounded.::-webkit-scrollbar-thumb
: This targets the thumb(the part of the scrollbar you drag to scroll). We set the
background
color to
#23a0a3
(a teal color in this case). The
border-radius
of
5px
rounds the corners of the thumb, making it more visually appealing and matching the style of the track.::-webkit-scrollbar-thumb:hover
: This modifies the thumb’s appearance when hovered over. We change the
background
color to a darker shade,
#1b7d7e
, to give users a visual cue when they hover.Note: These properties apply to WebKit browsers like Chrome and Safari. Firefox and Internet Explorer require different properties, which aren’t supported in Duda at this time.
The following are some adjustments you can make to personalize the scrollbar further:
::-webkit-scrollbar
):width: 15px;
to make the scrollbar thinner or thicker. For example, setting it to
10px
will create a slimmer scrollbar.::-webkit-scrollbar-track
):box-shadow: inset 0 0 10px #eeeeee;
to change the shadow’s color and strength.#eeeeee
to any color that matches your site’s theme.border-radius: 5px;
to control the roundness. A smaller number (e.g.,
2px
) makes it less rounded, while a larger number (e.g.,
10px
) makes it more rounded.::-webkit-scrollbar-thumb
):background: #23a0a3;
to any color that aligns with your brand.border-radius
similarly to control how rounded the thumb looks.::-webkit-scrollbar-thumb:hover
):#1b7d7e
) provides visual feedback to users. Feel free to change this color to create contrast with the regular thumb color.Let’s say you want a thinner scrollbar with a dark gray track and a blue thumb that turns light blue on hover.
Here’s how that code might look:
::-webkit-scrollbar {
width: 8px;
}
::-webkit-scrollbar-track {
box-shadow: inset 0 0 5px #444444;
border-radius: 2px;
}
::-webkit-scrollbar-thumb {
background: #007bff;
border-radius: 2px;
}
::-webkit-scrollbar-thumb:hover {
background: #66b2ff;
}
After customizing the scrollbar, make sure to:
That’s it! With these steps, you now have a customized scrollbar that matches your Duda site’s design and enhances user experience. Enjoy experimenting with different styles and colors to find the perfect fit for your website!
WIDGETS BY CRE8 MY SITE