By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,972 Members | 901 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,972 IT Pros & Developers. It's quick & easy.

Right align content of <INPUT> field

P: n/a
If it is possible, could someone demonstrate how to make the text
entered into an <INPUT TYPE=TEXTfield right-align within the entry
field, please?

The fields in my form are for numbers, and they look strange aligned left.

--
Steve Swift
http://www.ringers.org.uk
Sep 27 '06 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Steve Swift wrote:
If it is possible, could someone demonstrate how to make the text
entered into an <INPUT TYPE=TEXTfield right-align within the entry
field, please?

The fields in my form are for numbers, and they look strange aligned left.
input.whatever {
text-align: right;
}

But that will probably confuse users. I wouldn't recommend it.
Sep 27 '06 #2

P: n/a
If it is possible, could someone demonstrate how to make the text
entered into an <INPUT TYPE=TEXTfield right-align within the entry
field, please?
Have you already tryed align="right" or style="text-align: right"?

Sep 27 '06 #3

P: n/a
Have you already tried align="right" or style="text-align: right"?

I hadn't tried that, but it produced exactly the effect that I wanted.
Thank you!

And Leif, no need to worry about the "user" - that's me. I agree
entirely that it's a very odd effect when you're not expecting it!
However, I tend to use right-aligned fields in Word documents quite
regularly, so I'm over the worst of the effects!

--
Steve Swift
http://www.ringers.org.uk
Sep 27 '06 #4

P: n/a
On Wed, 27 Sep 2006 04:45:34 -0400, Leif K-Brooks
<eu*****@ecritters.bizwrote:
>Steve Swift wrote:
>If it is possible, could someone demonstrate how to make the text
entered into an <INPUT TYPE=TEXTfield right-align within the entry
field, please?

The fields in my form are for numbers, and they look strange aligned left.

input.whatever {
text-align: right;
}

But that will probably confuse users. I wouldn't recommend it.
A quick check of three different mobile phones reveals that they all
right-align the numbers being typed in, so I suggest that an awful lot
of people will already be familiar with the concept. (Pretty strange
actually - right-aligning *telephone* numbers isn't a sensible thing to
do, as there are no column weights involved. Telephone numbers are
really just a special kind of text string.)

--
Stephen Poley

http://www.xs4all.nl/~sbpoley/webmatters/
Sep 27 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.