Oleg Dats Oleg Dats - 6 months ago 41
CSS Question

How to vertically align text in input type="text"?

There is

<input type="text" />
I need to set vertical alignment of the entered text. For example middle or top.

Answer Source

Use padding to fake it since vertical-align doesn't work on text inputs.

jsFiddle example


.date-input {     
    width: 145px;
    padding-top: 80px;
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download