
Anonymous A. answered 01/05/20
CSS Expert with 10+ years of experience
I assume that "different values" mean hashmarks and labels, so here are my 2 cents.
There's an HTML value called "range" and it's added to the <input> element via the type attribute.
Here's how it looks:
That's it basically.
However, the range slider has many other attributes that make it much more usable. Here's a more detailed range slider:
As you can see we are introducing a few more attributes:
- min: The minimum value.
- max: The maximum value.
- step: The amount of steps the slider can increase/decrease its value.
There are many more attributes and ways to rotate the slider for a vertical format. Browser support is pretty decent for a basic slider, but for example, Firefox doesn't support hashmarks (the little lines along the slider) and labels (like 0% - 50% - 100%, etc.). While Chrome does support hashmarks but does not support labels.
More information in the Mozilla Developer Network (MDN): https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/range