Vikas
Vikas

Reputation: 277

How I can do vertically center alignment in TEXTAREA in HTML?

I want to do vertically center alignment of text in TEXT-AREA. Please suggest how I can do this?

Upvotes: 2

Views: 2588

Answers (2)

Joe Griffin
Joe Griffin

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

waders group
waders group

Reputation: 538

There are two ways to do it

  1. Direct positioning the textarea

    <textarea style="height: 300px; width: 400px;; top:50%; margin-top: -150px; position: absolute;"> </textarea>

  2. 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

Related Questions