2011-07-27 62 views
1

我有一個簡單的標籤,和大量的輸入框:排隊標籤和輸入正確

enter image description here

爲其代碼是這樣的:

<div id="total"><label>Total: <input type="tel" id="totalInput" onKeyUp="updateTotal()" /></label></div> 

和CSS:

label { 
    font-size: 16pt; 
    font-family: sans-serif; 
    margin-right: 0.5em; 
} 

input { 
    font-size: 16pt; 
    left: auto; 
    float:right; 
    width: 60%; 
} 

#total { 
    text-align:right; 
} 

但無法弄清楚如何將單詞「Total:」向下移動以使其居中對齊(或其他) ise看起來很對齊)到輸入框。

任何幫助,將不勝感激。

回答

0

你正在尋找的文本

class { 
    ... 
    line-height: 1.2; 
    ... 
} 
0

line-height屬性可以使用line-height移動標籤下

label {line-height: 1.5em;} //or there abouts 
0

可能是沒有現場演示胡亂猜測(我卻從未使用包裹輸入元素本身的標籤),但嘗試添加line-height:16pt到標籤選擇器。

label { 
    font-size: 16pt; 
    font-family: sans-serif; 
    margin-right: 0.5em; 
    line-height:16pt; 
}