Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to customize the HTML5 input range type looks using CSS?

I want to customize the looks of the range input type in HTML5 to look something like a progress bar. I've tried applying some common CSS attributes using CSS class but it seems that they are not working.

Can any one direct me how to customize it??

like image 893
ptamzz Avatar asked Aug 24 '10 11:08

ptamzz


People also ask

How do I style a range input in CSS?

To style the range input with CSS you'll need to apply styles to two pseudo-elements: ::-webkit-slider-thumb and ::-webkit-slider-runnable-track . Find out how you can apply custom styling and make the range input more functional and appealing. Contents of the article: CSS selectors for the range input.

How do you customize input tags in CSS?

If you only want to style a specific input type, you can use attribute selectors: input[type=text] - will only select text fields. input[type=password] - will only select password fields. input[type=number] - will only select number fields.

How do you change the input range color in HTML?

If the general appearance of the slider is fine, but the default blue color (in Chrome) needs to fit a theme color, apply a filter: hue-rotate(); to the input[type="range"] element. Other filters can be used. Some even change the background color of the slider.


1 Answers

input[type='range'] {     -webkit-appearance: none !important;     background:red;     height:7px; } input[type='range']::-webkit-slider-thumb {     -webkit-appearance: none !important;     background:blue;     height:10px;     width:10px; } 
like image 162
Eyal Avatar answered Sep 28 '22 04:09

Eyal