Alex Rivera | Logout

How to vertical-align text on this input box for IE

Asked 2011-06-20T14:22:08.927
9

I have this code :

<input type="text" class="contactInput" value="my string">

.contactInput
{
    border:0;
    margin:0;
    padding:0;
    background-color:#000000;
    color:#ffffff;
    height:22px;
    width:290px;
    padding-left:5px;
}

and I'd like to vertical-align it. Firefox and Chrome do it automatically (as IE9). With IE8 or 7 is in the top.

How can I do it with CSS?

Edit
Report

1 Answer

4

There is a problem with line-height in Chrome. When inline-height == height then chrome on picking edit box displays large cursor. When you start typing cursor decreases. Possible solution is to use paddings (top & bottom). In your case:

height: 18px;
padding-top: 4px;
answered 2013-04-29T13:53:37.217

Your Answer