在Firefox和Chrome中的输入高度差异 [英] input height differences in Firefox and Chrome

查看:582
本文介绍了在Firefox和Chrome中的输入高度差异的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为什么Chrome中的高度大于Firefox的输入

Why height in Chrome is bigger than Firefox of input

请参见 http://jsfiddle.net/jitendravyas/89Msh/1/

select, input, textarea, button {
    font: 99% sans-serif;
}

input, select {
    vertical-align: middle;
}

body, select, input, textarea {
    color: #444444;
}

button, input, select, textarea {
    margin: 0;
}


input, textarea {
    font-family: inherit;

    line-height: 1.5;
}


input {
    border: 0 none;
    font-size: 32px;
    line-height: 1.1;
    margin-right: 29px;
    padding: 3px 3px 0;
    width: 206px;
    border-radius: 7px;
}


推荐答案

c $ c> line-height 。

The problem is essentially line-height.

Chrome看到 line-height 它会看到 height 和Firefox不会。

Chrome sees line-height much like it sees height and Firefox doesn't.

为输入添加高度应该可以解决问题,请小心您的 line-height height 匹配。

Adding height to the input should solve the problem, though you should be careful that your line-height and height match.

例如: height:20px;

For example: height: 20px; line-height: 20px;.

http: //jsfiddle.net/e2agj/1/ - 上一个示例输入是正确的。

http://jsfiddle.net/e2agj/1/ - Last example input is the correct one.

这篇关于在Firefox和Chrome中的输入高度差异的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆