2014-02-06 123 views
0

我遇到與chrome輸入不一致的問題。Chrome輸入填充問題

我正在使用較大的字體大小,但將高度和線條高度設置得較小,以刪除文本上方和下方的間隙。

input { 
    font-size: 100px; 
    padding: 0; 
    margin: 0; 
    height: 80px; 
    line-height: 80px; 
} 

IE和Firefox似乎正確渲染它,但鉻似乎添加填充到輸入的文本。

搗鼓出什麼是怎麼回事:http://jsfiddle.net/tomdickie/nZY8r/1/

編輯:

增添幾分更加清晰,這個下面是一些截圖:

火狐

enter image description here

Chrome

enter image description here

我想讓Chrome的行爲像Firefox(和IE)一樣。

+1

這有幫助嗎? http://stackoverflow.com/questions/8981420/how-can-i-remove-the-extra-and-different-pseudo-padding-on-text-inputs-in-webki –

+0

檢查我的@ user2727841答案... – user2727841

+0

你有什麼版本的鉻? – user2727841

回答

-1

試試這個和它的迴環here

HTML代碼

<input type="text" name="uname" value="223" /> 

CSS代碼

input { 
    font-size: 100px; 
    padding: 0; 
    margin: 0; 
    /*height: 80px; 
    line-height: 80px;*/ 
} 

我測試過此代碼。

+1

「刪除文本上方和下方的空白處」。僞填充仍然存在 –