Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

input type number hide arrows from right part of input

I have 2 inputs with type number:

<input type="number">

http://jsfiddle.net/dkadr55g/1/

I want to hide arrows from the right for first input, I found solution using this code:

input[type=number]::-webkit-inner-spin-button, 
    input[type=number]::-webkit-outer-spin-button { 
    -webkit-appearance: none; 
     margin: 0; 
}

but if using this, all inputs doesn't create arrows

http://jsfiddle.net/dkadr55g/2/

how to set for first withoud arrows and for second with arrows?

like image 861
Alex Avatar asked Feb 04 '15 11:02

Alex


2 Answers

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>
like image 185
dfsq Avatar answered Sep 30 '22 11:09

dfsq


you can simply add a class to your input

Second number: <input class="without_number" type="number"><br>

Than you select only fields with this class:

input[type=number].without_number::-webkit-inner-spin-button, 
input[type=number].without_number::-webkit-outer-spin-button { 
    -webkit-appearance: none; 
     margin: 0; 
}
like image 21
DannielR Avatar answered Sep 30 '22 09:09

DannielR