2016-08-05 31 views
-1

我在HTML中的Bootstrap中創建了一個下拉菜單。我想要做的就是爲下拉列表中的每個元素添加圖片。 但是當我嘗試執行它時,沒有任何反應。下拉列表正常,但圖像不顯示。有人可以幫助在下拉菜單中添加圖像嗎?謝謝!在引導程序中爲每個下拉列表元素添加圖像

<div class="dropdown"> 
 
    Lingua &nbsp &nbsp 
 
    <button class=" btn btn-default " type="button" data-toggle="dropdown">Italiano 
 
    <span class="caret"></span> 
 
    </button> 
 
    <ul class="dropdown-menu"> 
 

 
    <li> 
 
     <a href="#"> 
 
     <img src="images/flag.png" width="35" height="30">1</a> 
 
    </li> 
 
    <li> 
 
     <a href="#"> 
 
     <img src="images/account.png" width="35" height="30">2</a> 
 
    </li> 
 
    </ul> 
 
    &nbsp &nbsp Paese &nbsp &nbsp</tab> 
 
    <button class="btn btn-default dropdown-toggle " type="button" data-toggle="dropdown">Italia 
 
    <span class="caret"></span> 
 
    </button> 
 
    <ul class="dropdown-menu"> 
 
    <li><a href="#">1</a> 
 
    </li> 
 
    </ul> 
 
</div>

這裏是我的結果: enter image description here 我爲油漆抱歉,我不得不刪除按鈕。

+0

是圖像正確來源? –

+0

Yeap thgey arew –

+1

請確實更新您的代碼... – vignesh

回答

0

YOC可以使用此代碼在CSS文件

ul { 
    list-style-image: url('Some.gif'); 
    } 
相關問題