我試圖做一個搜索欄,類別選擇和搜索查詢。
我試圖讓他們看起來都相同,相同大小的字體。
但我不想要的選項看起來相同大小的選擇標籤自定義選擇和輸入標籤,IE版本看起來很糟
<table>
<tr>
<td>
<div class="searchInput" style="postion:relative">
<select onchange="document.getElementById('category').value = this.options[this.selectedIndex].text">
<optgroup>
<option>Cat 1</option>
<option>Cat 2</option>
<option>Cat 3</option>
</optgroup>
</select>
<input id="category" style="postion:absolute width:300px" placeholder="Choose A Cateogry" value="Choose A Category">
</div>
</td>
<td>
<div class="searchInput">
<input type="text" placeholder="Search Query">
</div>
</td>
</tr>
div.searchInput input {
font-family: Arial, Helvetica, sans-serif;
font-size: 30px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
margin-left: 0px;
padding-top: 0px;
padding-right: 0px;
padding-bottom: 0px;
padding-left: 0px;
height: 100%;
}
div.searchInput select {
border:none;
font-size:20px;
padding:0px;
margin:0px;
height:38px;
width:300px;
color:transparent;position:absolute;
background-color:transparent;
}
div.searchInput {
color:black;
background-color: white;
}
div.searchInput {
overflow: hidden;
margin:0px;
padding:0px;
width:300px; border:
1px #000000 solid;}
body {
font-family:Helvetica Neue,Arial,Helvetica, sans-serif;
font-size: 16px;
background: #666;
background:rgba(9,9,9,0.6);
}
`
是我想出和它的周圍我想要的風格和大小。
但在Internet Explorer中看起來很糟糕。
這是爲什麼?我怎樣才能讓他們看起來一樣?如果不是,我的下一步路線是什麼?
你也應該發佈css,將來可能無法使用提琴。並且需要在'absolute'和'width'之間有一個分號。 –