Skip to content Skip to sidebar Skip to footer

How To Vertical-align Text On This Input Box For Ie

I have this code : .contactInput { border:0; margin:0; padding:0; background-color:#000000; co

Solution 1:

Assuming you mean vertically align in the centre, you can use the line-height CSS property to do this. Simply set it to be the same as the height of the element.

Solution 2:

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;

Solution 3:

For webkit, its better to use paddings to avoid giant cursor, like that.

line-height: 14px/*to enclose 13px font, override this if needed*/;
  height: 14px/*to enclose 13px font, override this if needed*/;
  /*Padding is needed to avoid giant cursor in webkit, which we get if
  height = line-height = 22px.*/padding: 6px8px;

Post a Comment for "How To Vertical-align Text On This Input Box For Ie"