【问题标题】:Button padding problems in firefox/operaFirefox/Opera 中的按钮填充问题
【发布时间】:2012-02-28 04:27:10
【问题描述】:

我的 HTML 按钮有问题。当我在 Opera 中放置按钮时,它位于中心(垂直),但在 Firefox 中,按钮文本看起来比 Opera 的稍低,这破坏了我的网站设计。

这里是html代码:

<input type="submit" value="Log In" id="button-log" />

这是css代码:

#button-log {
width:70px;
height:30px;
background-color:#1963FF;
}

这里没什么不寻常的吧?

但我真的不知道为什么登录文本出现在 Firefox 中,而在 Opera 中却没有。

如果有人帮忙,我真的很感激。

【问题讨论】:

标签: html css


【解决方案1】:

试试这个..

#button-log {
    width:70px;
    height:30px;
    padding:3px 0;
    background-color:#1963FF;
}

【讨论】:

    【解决方案2】:

    在按钮 CSS 中添加 line-height

    #button-log {
        line-height:24px; // or you can adjust accord to your need
        width:70px;
        height:30px;
        padding:3px 0;
        background-color:#1963FF;
    }
    

    【讨论】:

      猜你喜欢
      • 2013-03-02
      • 2011-06-20
      • 1970-01-01
      • 1970-01-01
      • 2012-03-19
      • 2011-07-04
      • 2014-12-02
      • 2012-05-29
      • 2019-08-11
      相关资源
      最近更新 更多