I am having trouble vertical aligning text in an input field in Internet Explorer.
I have:
input#search {
float:left;
font-size:11px;
height:20px;
margin:0;
padding-left:4px;
width:100px;
}
In Firefox and Chrome, it seems to be automatically vertical aligned, however in Internet Explorer it is not.
Just define
line-height
andheight
for a text box with same value. It will be taken careCheck the parent div. If it's empty you need to add content (&nbps;) so explorer will calc the height correctly.
Setting
line-height:1
might mitigate the vertical alignment and a bit ofpadding:.15em
should add some breathing space to the fields too.Just set the height and line-height for the input object and it works fine (ie 7+).
gl Paulo Bueno
You can use IE conditional comment like this: