Reputation: 47
I am using box for token code purpose but input text alignment is coming different in different browser. In Chrome:
In Internet Explorer:
My code for input text and for box is below:
<style>
input.box {
height: 9px;
padding: 3px 3px 8px;
border: 1px solid #999;
width: 145px;
padding-top: 4px;
}
</style>
<input path="token" id="token" tabindex="2" maxlength="35" class="box"
placeholder="token" />
we can see the bottom space is more in Chrome compare to Internet Explorer in the box.
Please let me know, how to fix this?
Upvotes: 1
Views: 339
Reputation: 5325
Assuming you mean you can use the line-height
CSS property to do this. Simply set it to be the same as the height
of the element.
Upvotes: 1
Reputation: 2073
Since <input>
Elements, or form elements in general, depending on the browser itself, it is up to the browser (and the operating system), how they look. So for example padding
is supported by Chrome and Firefox on Windows, but the IE does not support it.
As a workaround, you could add a line-height
, look at the example below:
input.box {
height: 9px;
padding: 3px 3px 8px;
border: 1px solid #999;
width: 145px;
padding-top: 4px;
line-height: 8px;
}
<input path="token" id="token" tabindex="2" maxlength="35" class="box"
placeholder="token" />
Upvotes: 1
Reputation: 2948
You can edit the CSS like this answer:
input.box {
height: 15px;
padding: 5px;
border: 1px solid #999;
width: 145px;
vertical-align: middle;
display: inline-block
}
<input path="token" id="token" tabindex="2" maxlength="35" class="box" placeholder="token" />
Upvotes: 1