Vertically aligning text in a textarea

Bes

Bes

Soldato
Joined
18 Oct 2002
Posts
7,318
Location
Melbourne
Hi,

The above is driving me crazy- I cannot find a decent way (CSS/ Javascript/ jquery whatever) to get text to be vertically aligned to the centre of a text area- so even if the user types more text in, it stays vertically aligned to the centre.

Can anyone help?

Thanks
 
Correct me if i'm wrong, but this is one area where CSS falls down (or at least CSS with cross browser compatibility)... you may have to use a table with the text inside for this (valign = middle) IIRC. :o
 
Use the table cell to create a false textarea. Place the true textarea within that table cell [valign'ed, of course], with borders removed and with some padding in the cell to avoid the true textarea from going right to the edges.
 
Use the table cell to create a false textarea. Place the true textarea within that table cell [valign'ed, of course], with borders removed and with some padding in the cell to avoid the true textarea from going right to the edges.

That's a good idea, but some browsers add a scroll bar to the right
 
hey would this method definately work? What do you mean by a false text area?

/noob

Thanks

It might work in certain browsers, but some browsers add a disabled vertical scroll bar to text areas. Say you're making some sort of internal system where you know exactly what browser software people are using, you may get away with it.
 
It might work in certain browsers, but some browsers add a disabled vertical scroll bar to text areas. Say you're making some sort of internal system where you know exactly what browser software people are using, you may get away with it.

Afraid not, people could be using anything :(
 
Back
Top Bottom