469,572 Members | 1,357 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,572 developers. It's quick & easy.

Right align content of <INPUT> field

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
4 54139
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
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
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
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.

Similar topics

5 posts views Thread by Jonathan Daggar | last post: by
5 posts views Thread by Mikko Rantalainen | last post: by
5 posts views Thread by Bart van Deenen | last post: by
2 posts views Thread by Richard Maher | last post: by
1 post views Thread by test9991014 | last post: by
reply views Thread by suresh191 | last post: by
4 posts views Thread by guiromero | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.