Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I align numeric input right and text input left with CSS?

Tags:

css

If I have two <input type="text" ... and I know that one should accept text and the other a numeric value (and will check that in PHP when validating the form), can I align the contents of the text box left & the contents of the numeric box right using CSS?

like image 588
Mawg says reinstate Monica Avatar asked Sep 25 '10 01:09

Mawg says reinstate Monica


1 Answers

<style type="text/css">
     .right { text-align: right; } </style>

<input type="text" /> <input type="text" class="right"/>
like image 166
Rob Avatar answered Sep 18 '22 18:09

Rob