Kuntady Yathish
Kuntady Yathish

Reputation: 49

How can I make cursor vertical alignment to middle if the input text tag height is more than the text height?

When I use the following code, text box size is increased to 300px, but when I type the text in it, it aligns at the top left corner. I want text to be aligned vertically in the center left rather than the top left.

<input type="text" style="valign:middle; with:250px;height:300px;">

Where am I going wrong? Is there any other solution for this?

Upvotes: 2

Views: 4443

Answers (3)

Mahdi Khodabandeh
Mahdi Khodabandeh

Reputation: 1

After some research found this:

input { line-height: normal; }

Upvotes: 0

Lepanto
Lepanto

Reputation: 1413

Try adding line-height

<input type="text" style="valign:middle; with:250px;height:300px;line-height:300px;">

Upvotes: 0

christian.s
christian.s

Reputation: 447

you want this?

<input type="text" 
style="text-align:center;valign:middle; width:250px;height:300px;">

otherwise it's unclear for me..

Upvotes: 1

Related Questions