我有選擇輸入一個問題來正確顯示在Internet Explorer,但它運作良好,在Firefox,Safari和Chrome。的CSS - 選擇選項(背景圖片)填充左或TEXT-INDENT問題上IE
選擇選項去一路下跌到左邊,應該有左填充爲在Chrome,Safari和Firefox 60像素。
請我準備的jsfiddle測試。你能幫忙嗎?
HTML
<div id="form-selector">
<select name='someinput' id='someinput' class="form-control img-input">
<option value="" selected="selected">1</option>
<option value="">2</option>
</select>
</div>
CSS:
#form-selector select {
overflow: -moz-hidden-unscrollable;
width: 100%;
height: 35px;
background:#fff;
margin-bottom:14px;
font-size: 14px;
color:#000000;
-webkit-appearance: menulist;
}
// Firefox Fix
@-moz-document url-prefix() {
#form-selector select {
text-indent: 30px;
} }
.img-input {
background:url(http://placehold.it/60x30) no-repeat left center #ffffff !important;
padding-left:60px; }
JS FIDDLE
https://jsfiddle.net/nitadesign/02uj91gp/15/
所以它應該但不是。請檢查Firefox! – Nita
這是因爲您添加了額外的Firefox特定縮進,因此不再需要這種縮進。只要刪除它,它將在Firefox中工作 - https://jsfiddle.net/wfrgyLg7/1/。我剛剛更新了我的答案,以覆蓋此(並顯示新的鏈接):) –
這是我的出發點之前,我問這個問題。現在任何人都可以在Safari上檢查它。當時我沒有Mac訪問權限,並且使用這些css設置,我遇到了Safari的問題。一旦我修復Safari,IE出現問題。 – Nita