How to align texts inside of an input?

phz picture phz · Aug 24, 2012 · Viewed 412.7k times · Source

For all default inputs, the text you fill starts on the left. How do you make it start on the right?

Answer

elias picture elias · Aug 24, 2012

Use the text-align property in your CSS:

input { 
    text-align: right; 
}

This will take effect in all the inputs of the page.
Otherwise, if you want to align the text of just one input, set the style inline:

<input type="text" style="text-align:right;"/>