Reputation: 277
I want to do vertically center alignment of text in TEXT-AREA. Please suggest how I can do this?
Upvotes: 2
Views: 2588
Reputation: 1
Click this example of Vertical Middle
This may be what you are looking for. Straight HTML. Click the image above.
<table width="40%" height="200">
<td height="150" valign="middle">
<font size="3" face="Arial, Helvetica, sans-serif">
Yay, I am in the Vertical Middle!!!!!
</font>
</td>
</table>
Upvotes: -1
Reputation: 538
There are two ways to do it
Direct positioning the textarea
<textarea style="height: 300px; width: 400px;; top:50%; margin-top: -150px; position: absolute;">
</textarea>
Use table property in element style
<div style=" display: table-cell; vertical-align: middle; height: 300px; width: 400px;">
<textarea style="height: 200px; width: 500px; display: table-cell;"></textarea>
</div>
Upvotes: 2