I can't believe I haven't been able to find anything about this problem.
In my new project the future user will have a column with some input type="number"
, and as numeric fields (there is not a single text
one) I want the numbers aligned to the right.
I found the numbers too close to the arrows so, logically, I added to them a padding-right
.
To my surprise, It seems I can't separate a little the numbers from the arrows. padding-right
moves the arrows along the numbers.
Basically only Opera
do the padding
the right way. but not the other main 3 browsers I have tested so far as you can see in the image below.
So. Is there any way to separate numbers from arrows so it works at least in Firefox
and Chrome
(as we recomend for our web app's these 2 browsers?)
a JSFIDDLE with a simple example
Right-click the selection rectangle of the shape or text box you want to change. On the shortcut menu, click Format <object type>, and then click the Text Box tab. Under Text Box Margins, adjust the measurements to increase or decrease the distance between the text and the outer border of the text box or a shape.
Use the CSS text-align Property to Center a Form in HTML The text-align property takes the values like left , right , center , justify , etc. We can set the value to center to center the form. For example, apply the text-align property to the form tag in the style attribute, and set the property to center .
Rather than using padding-right
use the following CSS
input::-webkit-outer-spin-button, input::-webkit-inner-spin-button { margin-left: 20px; }
and for Firefox above solution won't work, so the best solution is just to hide it :
input[type=number] { -moz-appearance:textfield; }
or you can try to "play" with some jquery plugin.
This is pretty annoying, in my case i solved the situation by passing the spinner to the left.
<input dir="rtl" type="number"/>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With