Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to hide the new HTML5 spinbox controls shown in Google Chrome & Opera? [duplicate]

Google Chrome now, and Opera before, shows a "spin box" control beside a input field of type "number". I want to be able to style this, or hide it. Are there ways of controlling this UI element yet?

EG: alt text <-- That little ui element with an up and down arrow. It's not that functional and its adding unnedded elements to a form I've created.

I understand I can just not have the type as "number" but it allows built in prevention of entering anything other than a number, and is semantically correct.

like image 948
Mike Scott Avatar asked Aug 20 '10 02:08

Mike Scott


1 Answers

At the moment, the answer is no - as far as I know anyway.

The HTML5 spec generally doesn't want to dictate what the user interface should look like, this also applies to the input type=number feature. I think there is a sort of implicitly expected workflow which goes somewhat like

input from authors/browser vendors/interesting people > spec text in HTML spec > implementations (experimenting with UI) > UI conventions (experimenting with styling) > CSS proposals > CSS spec for how to style the new controls.

Hence, real control over the rendering of the new inputs won't be possible in the near future. Of course, browsers may meanwhile implement experimental vendor-specific CSS extensions..

like image 58
hallvors Avatar answered Sep 17 '22 15:09

hallvors