How to Make Scrollbar Custom Arrows Work on Mobile Devices?

Custom scrollbars can enhance the visual appeal of your website by providing a unique user experience. While modern browsers support custom scrollbar styling through WebKit CSS properties, making these work consistently across mobile devices requires specific techniques.

Syntax

::-webkit-scrollbar {
    width: value;
}
::-webkit-scrollbar-thumb {
    background: color;
}
::-webkit-scrollbar-track {
    background: color;
}

WebKit Scrollbar Properties

Property Description
::-webkit-scrollbar Styles the overall scrollbar element
::-webkit-scrollbar-thumb Styles the draggable part of the scrollbar
::-webkit-scrollbar-track Styles the background track of the scrollbar
::-webkit-scrollbar-button Styles the arrow buttons on the scrollbar
Note: Custom scrollbars using WebKit properties work primarily on Chromium-based browsers and Safari. For better mobile compatibility, consider fallback solutions.

Example 1: Basic Custom Scrollbar

This example demonstrates a simple custom scrollbar that works on mobile WebKit browsers

<!DOCTYPE html>
<html>
<head>
<style>
    .scroll-container {
        max-width: 400px;
        max-height: 200px;
        overflow-y: scroll;
        overflow-x: hidden;
        padding: 15px;
        border: 1px solid #ddd;
    }
    .scroll-container::-webkit-scrollbar {
        width: 8px;
    }
    .scroll-container::-webkit-scrollbar-track {
        background: #f1f1f1;
        border-radius: 4px;
    }
    .scroll-container::-webkit-scrollbar-thumb {
        background: #888;
        border-radius: 4px;
    }
    .scroll-container::-webkit-scrollbar-thumb:hover {
        background: #555;
    }
</style>
</head>
<body>
    <div class="scroll-container">
        <h3>Tutorials Point</h3>
        <p>Tutorials Point originated from the idea that there exists a class of readers who respond better to online content and prefer to learn new skills at their own pace from the comforts of their drawing rooms. The journey commenced with a single tutorial on HTML in 2006 and elated by the response it generated, we worked our way to adding fresh tutorials to our repository which now proudly flaunts a wealth of tutorials and allied articles on topics ranging from programming languages to web designing to academics and much more.</p>
    </div>
</body>
</html>
A scrollable container with custom gray scrollbar appears. The scrollbar has rounded corners and changes color on hover.

Example 2: Custom Scrollbar with Arrows

This example shows how to style scrollbar arrows for mobile compatibility

<!DOCTYPE html>
<html>
<head>
<style>
    .arrow-scrollbar {
        width: 350px;
        height: 180px;
        overflow: auto;
        border: 2px solid #007bff;
        padding: 10px;
    }
    .arrow-scrollbar::-webkit-scrollbar {
        width: 16px;
        background-color: #f0f0f0;
    }
    .arrow-scrollbar::-webkit-scrollbar-thumb {
        background-color: #007bff;
        border-radius: 8px;
    }
    .arrow-scrollbar::-webkit-scrollbar-button:single-button {
        background-color: #0056b3;
        height: 16px;
        width: 16px;
        border: 1px solid #004085;
    }
    .arrow-scrollbar::-webkit-scrollbar-button:vertical:decrement {
        border-bottom: 2px solid #004085;
    }
    .arrow-scrollbar::-webkit-scrollbar-button:vertical:increment {
        border-top: 2px solid #004085;
    }
</style>
</head>
<body>
    <div class="arrow-scrollbar">
        <h4>Custom Scrollbar with Arrows</h4>
        <p>This scrollbar features custom arrow buttons that work on mobile WebKit browsers. The arrows are styled with blue colors matching the scrollbar theme.</p>
        <p>Scroll down to see more content and test the custom arrows functionality.</p>
        <p>Additional content to demonstrate scrolling behavior with custom styled scrollbar arrows.</p>
    </div>
</body>
</html>
A blue-themed scrollable container with custom arrow buttons appears. The scrollbar has styled up and down arrow buttons with blue coloring.

Mobile Compatibility Considerations

  • WebKit Support: Custom scrollbars work on iOS Safari and Android Chrome
  • Touch Scrolling: Mobile devices primarily use touch scrolling, making custom arrows less visible
  • Responsive Design: Consider hiding custom scrollbars on small screens using media queries
  • Accessibility: Ensure sufficient contrast and touch-friendly sizing for mobile users

Conclusion

Custom scrollbar arrows can enhance user experience on mobile devices when implemented correctly using WebKit CSS properties. However, consider that mobile users primarily interact through touch gestures, so focus on making the scrollbar visually appealing rather than just functional.

Updated on: 2026-03-15T16:55:10+05:30

2K+ Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements