Fred Rost
Fred Rost

Reputation: 181

Right justifying numbers in an input field

Using this example, how would I right justify numbers in the input fields?

<form name="input" action="html_form_action.asp" method="get">
  Taxes: <input type="number" name="Taxes" value="" /><br /> Shipping: <input type="number" name="shipping" value="" align="right" /><br />
  <input type="submit" value="Submit" />
</form>

<p>Click the "Submit" button, the form-data will be sent to a page called "html_form_action.asp".</p>

Upvotes: 18

Views: 23087

Answers (1)

alexn
alexn

Reputation: 59002

Style your input with:

text-align: right;

This will right justify all text in your input.

Upvotes: 27

Related Questions