Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google chrome vertical <input type="range" />

On opera, i can do the following

<style>
#range{
 width: 20px;
 heigth: 300px;
}
</style>

<input type="range" id="range" />

and it will render a vertical slider. However, this doesn't seem to work on chrome. Is there a way I can do this? (I'm not looking for any jQuery sliders or anything)

like image 988
Timo Willemsen Avatar asked Feb 15 '11 08:02

Timo Willemsen


People also ask

How do you make a vertical slider range?

To create a vertical slide, edit the range slider field and in the advanced tab enter wsf-range-vertical into the Classes –> Field Wrapper setting.

How do I create a vertical range slider in HTML?

For Chrome, use -webkit-appearance: slider-vertical . For IE, use writing-mode: bt-lr . For Firefox, add an orient="vertical" attribute to the html. Pity that they did it this way.

How do you control input range?

Creating vertical range controls By default, browsers render range inputs as sliders with the knob sliding left and right. To create a vertical range, wherein the knob slides up and down, set the CSS appearance property to slider-vertical and include the non-standard orient attribute for Firefox.


1 Answers

It seems Chromium does not yet implement support for this yet:

See: http://www.chromium.org/developers/web-platform-status/forms

Not available yet

  • Localization of
  • Dedicated UIs for color, date, datetime, datetime-local, month, time, and week types
  • Automatic switching to vertical range
  • Value sanitization algorithms
  • datalist element, list attribute, and list/selectedOption properties

Edit: Vuurwerk indicated that it is actually possible to alter the presentation using the -webkit-appearance: slider-vertical property. Although this does transform it into a vertical slider, I would not recommend doing this, since it will break your layout and doesn't look really pretty: example.

If you really want a vertical slider, use a JavaScript solution. Support for <input type="range" /> is very basic at the moment anyway, so you are probably better off with a graceful degradation or progressive enhancement approach.

like image 74
Aron Rotteveel Avatar answered Sep 21 '22 13:09

Aron Rotteveel