views:

3075

answers:

2

I am currently trying to justify text in a textarea, unfortunately the CSS:

text-align: justify;

Doesn't work on the text like center, left and right do. I've tried this in both Firefox 3 and IE 7 with no luck.

Is there any way around this?

+2  A: 

I believe that common practice is to use the TEXTAREA for input without worying about justification; and then, once the input is processed (i.e. the FORM is submitted, or an event of the TEXTAREA is captured), the contents are displayed in a non-editable text element (such as P, SPAN, TD) where the text-align: justify; style attribute will be honored.

Ken Paul
I agree, the client is after this as part of the design though, so unfortunately that that's not appropriate for the situation. Thanks though.
Matt
Then I think the simple answer is NO. A Google search on "textarea justify" shows lots of similar questions with no usable solution except maybe to replace the `TEXTAREA` with a Rich Text widget.
Ken Paul
Thats what I had come up with as well before asking here unfortunately. Thanks for your help.
Matt
+1  A: 

i dont think this is possible in the html textarea element. you might be able to use some sort of wysiwyg editor (editable div). ie. fckeditor

John Boker
Thats what I've found as well trawling through Google search results, just hoping that someone here may know of something I might have missed. Thanks.
Matt