假設我有following html and style:如何使輸入和選擇看起來不錯,旁邊有自定義高度eachother?
HTML
<div id="container">
<input type="text"/>
<select><option>val</option></select>
</div>
CSS
* {
box-sizing: border-box;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
}
input, select {
width: 50%;
float: left;
height: 3em;
line-height: 3em;
}
我怎樣才能使輸入和選擇好看嗎?在Firefox中,選擇的高度很好,但文字val
寫在選擇的頂部,在webkit瀏覽器中,選擇的高度不變。
有沒有什麼辦法可以將這些選擇和輸入用自定義高度設置爲在大多數現代瀏覽器(firefox,webkit,opera,> = IE8也許?)中看起來不錯?
請參照這些。 HTTP://計算器。com/questions/8189668/why-does-select-have-a-slightly-height-height-than-inputtype-text http://stackoverflow.com/questions/9767612/issue-with-input-select-tag -height-in-form http://stackoverflow.com/questions/4561798/same-size-widthxheight-for-input-and-select – Nitesh