Styling input type range elements in Webkit browsers

14,118

Solution 1

I've only heard of the type range, not slider.

input[type="range"] {
    -webkit-appearance: slider-horizontal;
}

Solution 2

There is a pretty good article on styling a range to make it look like an iPhone slider written by David B. Calhoun.

I think the blog post should cover most aspects of styling a range input type.

Here is some of the CSS:

input[type='range']::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 68px;
    height: 44px;
    -webkit-border-radius: 10px;
    border-radius: 10px;
    -webkit-gradient(
        linear,
        left top,
        left bottom,
        color-stop(0, #fefefe),
        color-stop(0.49, #dddddd),
        color-stop(0.51, #d1d1d1),
        color-stop(1, #a1a1a1)
    );
    background-repeat: no-repeat;
    background-position: 50%;
}
Share:
14,118
Vinay Verma
Author by

Vinay Verma

Updated on July 24, 2022

Comments

  • Vinay Verma
    Vinay Verma over 1 year

    Is there any way to style <input type="range"> elements for Webkit browsers?