我有一个带文本的按钮,文本似乎没有在按钮内垂直对齐。这只发生在IE 10上。铬是完美的。
HTML

<input type="text" id="postcode" name="Postcode" class="input" placeholder="enter your postcode..." maxlength="8" size="10"><button class="button" type="submit" id="postcode">FIND DEALS</button>

CSS
.banner-input button{
    background: #0072bc;
    font-family: "Myriad Pro", 'Open Sans', sans-serif;
    font-size: 15px;
    font-weight: 600;
    width: 108px;
    height: 54px;
    margin: 0 0 0 10px;
    border: 1px solid #00548a;
    -webkit-box-shadow: rgba(0,0,0,0.5) 0px 1px 0px,#2888c7 0px 1px 0px inset;
    -moz-box-shadow: rgba(0,0,0,0.5) 0px 1px 0px,#2888c7 0px 1px 0px inset;
    box-shadow: rgba(0,0,0,0.5) 0px 1px 0px,#2888c7 0px 1px 0px inset;
    -webkit-border-radius: 6px;
    -moz-border-radius: 6px;
    border-radius: 6px;
    background: #005f9c;
    filter: progid:DXImageTransform.Microsoft.gradient(gradientType=0, startColorstr='#FF0072BC', endColorstr='#FF005F9C');
    background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #f7b814), color-stop(100%, #ff9100));
    background-image: -webkit-linear-gradient(top, #0072bc 0%, #005f9c 100%);
    background-image: -moz-linear-gradient(top, #0072bc 0%, #005f9c 100%);
    background-image: -o-linear-gradient(top, #0072bc 0%, #005f9c 100%);
    background-image: linear-gradient(top, #0072bc 0%, #005f9c 100%);
    color: #fff;
    line-height: 40px;
    vertical-align: middle;
}

我试过各种线条高度和衬垫。似乎什么都没用。:。(

最佳答案

尝试设置行高=高度-->line-height: 54px;

10-07 19:41
查看更多