HTML 定义值时 Chrome 中的按钮输入位置关闭
HTML button input position is off in Chrome when value is defined
此 jsfiddle 在 IE 11 中按预期工作,但在 Chrome 中,第二个按钮的位置低于应有的位置。我发现重现问题所需要做的就是在第二个按钮中设置一个值。如何修复?
<input style="width:42px; height: 42px" type="button" />
<input style="width:42px; height: 42px" type="button" value="1" />
只需将垂直对齐 属性 设置为顶部:
input[type=button] {
vertical-align:top;
}
内联元素的默认垂直对齐值为 baseline。
此 jsfiddle 在 IE 11 中按预期工作,但在 Chrome 中,第二个按钮的位置低于应有的位置。我发现重现问题所需要做的就是在第二个按钮中设置一个值。如何修复?
<input style="width:42px; height: 42px" type="button" />
<input style="width:42px; height: 42px" type="button" value="1" />
只需将垂直对齐 属性 设置为顶部:
input[type=button] {
vertical-align:top;
}
内联元素的默认垂直对齐值为 baseline。