簡體   English   中英

選擇選項未在Internet Explorer中顯示

[英]Select option not displaying in Internet explorer

以下選擇選項在Firefox / Chrome中顯示正常,但在IE8中顯示不正常。 請幫忙。

<select id = "vehicle" name = "vehicle" class = "vehicleSelect">
<option value = "-1" selected>&nbsp;</option>
<option value = "15">Car</option>
<option value = "16">Bike</option>
<option value = "17">Train</option>
</select>

CSS:

.vehicleSelect
{
    width: 100%;
    height: 100%;
    font: 10px/1.45em "Lucida Grande",Verdana,Arial,Helvetica,sans-serif;
    padding: 3;
    border: 0;
}

您正在刪除選擇框中的標准邊框,因此在各種瀏覽器中它看起來自然很奇怪。 考慮刪除height: 100%border:0

您也不應在HTML標簽屬性中添加空格。 根據瀏覽器的不同,它可能會導致各種問題,而且這也是一種很好的做法。

<select id = "vehicle" name = "vehicle" class = "vehicleSelect">

應該:

<select id="vehicle" name="vehicle" class="vehicleSelect">

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM