Chrome上的按钮样式与其他样式不同

时间:2013-08-27 07:03:59

标签: html css cross-browser

我想使用font-awesome和bootstrap中的facebook图标设置“使用facebook登录”按钮的样式

为此我有以下html

    <a href="#" class="btn btn-large login_facebook">
<i class="icon-facebook"> </i> | Sign in with Facebook</a>

并添加适当的css

.login_facebook {
    background: #6e86bd;
    background: -moz-linear-gradient(top, #6e86bd 0%, #6680b9 100%);
    background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#6e86bd), to(#6680b9));
    border-top: 1px solid #3f5b98;
    border-left: 1px solid #3f5b98;
    border-bottom: 1px solid #3f5b98;
    border-right: 1px solid #3f5b98;
    -moz-border-radius: 6px;
    -webkit-border-radius: 6px;
    border-radius: 6px;
    -moz-box-shadow: inset 0 1px 0 0 #abbbdf;
    -webkit-box-shadow: inset 0 1px 0 0 #abbbdf;
    box-shadow: inset 0 1px 0 0 #abbbdf;
    color: #fff;
    font-weight: bold;
    text-align: center;
    text-shadow: 0 -1px 1px #344d80;
    margin: 0 0 10px 0;
    vertical-align: top;
    position: relative;
}
.login_facebook .icon-facebook {
    font-size: 37px;
    vertical-align: bottom;
    position: relative;
    bottom: 0;
    line-height: 0px;
}

在chrome上f图标与按钮底部对齐,但在firefox上,即它不是

最终结果应该在所有浏览器上都是这样的

enter image description here

最好见于jsfiddle http://jsfiddle.net/KM2tS/1/

我猜我需要在这里添加浏览器特定的样式,但是哪种样式?有没有办法让所有浏览器在这个特定的情况下表现相同?

1 个答案:

答案 0 :(得分:0)

@-moz-document url-prefix() 
{
    .icon-facebook:before
    {
        height: 5px !important;
    }

}

添加以上样式并尝试。