Select Categories Below
Advertisement
Start Your Own Q&A Site
Create your own Q&A site easily, allowing you to quickly grow a new community around any subject matter or generate new organic traffic for your existing website.
Status: Closed Points: 75 Time: 06:32 - Nov 21, 2006
mary2
I am looking to have the text within a textbox centered, does anyone know how to accomplish this?
Categories:
Add Categories
When adding more than one category, separate them with commas.
jgivoni
Date:: Nov 21, 2006
Time:: 12:06
Hi John2, There are two kinds of textboxes in HTML, <input type="text"> and <textarea> For the first one (<input type="text">) I don't think it is possible to change the alignment (not even CSS's direction: rtl seems to have any effect...) but for the <textarea> it is quite simple with style="text-align: center" You can change the height of a <textarea> to make it look like an <input type="text"> field :-)
Time:: 13:32
Hi Jgivoni, I actually found the answer myself also. I was able to center the textbox like this: <input type="text" style="text-align:center"> It worked like a charm. Thanks for your input.
Date:: Feb 11, 2007
Time:: 12:41
I realized that my first answer relied on a typing error, therefore I couldn't get it to work! John is right, "text-align: center" is all that is needed. Sorry for my mistake.
bundimun211
Date:: Aug 23, 2007
Time:: 01:39
thanks for d answer...it really helps :)
Question Answered
This question has been closed, and points have been rewarded to the following experts:
You're welcome however to comment or give additional information or if you wish, you have the ability to write a Tutorial in the Tutorial Area.
Answer this Question
New User
Email:
Upon submission of this form, you will automatically be registered as a Quomon user and we will send your login information to this address
Registered User
Username:
Password:
Forgot Your Password?
Enter your email address below and we will resend your login information to you.
Login Information Sent
Time:: 12:43
The simple solution: text-align: center This css property will center text within textboxes and textareas. Examples: <input type="text" style="text-align: center"/> <textarea style="text-align: center"></textarea>
Click here to see the Answer Discussion that preceded this tutorial.
Login to rate this tutorial: Good | Bad
Questions
Why is the link aligning to the bottom next to an image?
need validation controller for textbox in java
How do I set a cell's width in CSS?
How can I center a background image?
How do i link textbox to datagridview without a database or dataset in visual...
You have 100 characters to use
Rank
Expert
Points
1.
10354
2.
6493
3.
5596
4.
4848
5.
3487
6.
2840
7.
2770
8.
2303
9.
1820
10.
917
Register today to share your knowledge with the community and be recognized and rewarded for your contributions.
Register Here
"Psst, Quomon is a great site. Pass it on." Tell a Friend | Link To Us | Save to Delicious | Digg it
Language Options
English:
Español:
Sponsors
Questions and Answers Software