2016-08-25 168 views
0

我有以下代碼來顯示一個通用按鈕文本:https://jsfiddle.net/6ogo4bqr/垂直對齊按鈕文字?

<input id="Button1" type="button" value="Log In" class="btn1" /> 
<br /> 
<input id="Button2" type="button" value="Log In" class="btn2" /> 
<br /> 
<div id="Button3" class="btn3">Log In</div> 

它工作在Firefox,但在iPad上精細的按鈕,文本顯示更傾向於在按鈕的上方(雖然它是確定,當它使用HelveticaArial):

Screenshot

我怎樣才能讓文字在iOS垂直對齊(BTW我無法得到的jsfiddle使用@字體面)?

回答

0

我最終發現我使用的特定字體文件已損壞。當我替換文件時,它一切正常。

0

嘗試並刪除文本的頂部和底部填充並添加line-height

+0

謝謝 - 我試過了,但它沒有工作 - 按照其他線高度 – user1946932

0
#selector{ 
    /*set both top and bottom padding with same values */ 
    padding-top: 20px; 
    padding-bottom: 20px; 
} 
+0

感謝 - 我試過,但它沒有奏效。請注意,我的原始JSFiddle事實上工作時,字體是Helvetica而不是FuturaMaxiBold – user1946932