Can I hide the HTML5 number input’s spin box?
This CSS effectively hides the spin-button for webkit browsers (have tested it in Chrome 7.0.517.44 and Safari Version 5.0.2 (6533.18.5)):
input::-webkit-outer-spin-button,input::-webkit-inner-spin-button { /* display: none; <- Crashes Chrome on hover */ -webkit-appearance: none; margin: 0; /* <-- Apparently some margin are still there even though it's hidden */}
input[type=number] { -moz-appearance:textfield; /* Firefox */}
<input type="number" step="0.01" />
Hide HTML5 input type number arrow with a css class?
Answer
.no-spin::-webkit-inner-spin-button, .no-spin::-webkit-outer-spin-button {
-webkit-appearance: none !important;
margin: 0 !important;
}
.no-spin {
-moz-appearance:textfield !important;
}
<input type="number" class="no-spin"/>
input type number hide arrows from right part of input
Just add some class to distinguish inputs:
input[type=number].no-spinner::-webkit-inner-spin-button, input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
First number: <input type="number" class="no-spinner"><br>Second number: <input type="number"><br>
Disable webkit's spin buttons on input type=number?
The below css works for both Chrome and Firefox
input[type=number]::-webkit-outer-spin-button,
input[type=number]::-webkit-inner-spin-button {
-webkit-appearance: none;
margin: 0;
}
input[type=number] {
-moz-appearance:textfield;
}
Hide Up & Down Arrow Buttons (Spinner) in Input Number - Firefox 29
According to this blog post, you need to set -moz-appearance:textfield;
on the input
.
input[type=number]::-webkit-outer-spin-button,input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0;}
input[type=number] { -moz-appearance:textfield;}
<input type="number" step="0.01"/>
How to remove the arrows from input[type=number] in Opera
I've been using some simple CSS and it seems to remove them and work fine.
input[type=number]::-webkit-inner-spin-button, input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; -moz-appearance: none; appearance: none; margin: 0; }
<input type="number" step="0.01"/>
Is there a way to hide the new HTML5 spinbox controls shown in Google Chrome & Opera?
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..
Related Topics
How to Write Data to File Using Only JavaScript
How to Get Value of Selected Radio Button
Converting HTML String into Dom Elements
How to Have an Element With an Id That Starts With a Number
How to Get a File or Blob from an Object Url
Difference Between Relative Path and Absolute Path in JavaScript
How to Use HTML Tags in the Options For Select Elements
Get City Name Using Geolocation
Submit Multiple Forms With One Submit Button
Get the Position of a Div/Span Tag
Jquery Set Cursor Position in Text Area
In What Situations Would Ajax Long/Short Polling Be Preferred Over Html5 Websockets
How to Dynamically Change a Web Page'S Title
How to Pass Parameters Using Ui-Sref in Ui-Router to the Controller
How to Detect Ctrl+V, Ctrl+C Using JavaScript
Are HTML Comments Inside Script Tags a Best Practice
How to Show Page Loading Div Until the Page Has Finished Loading