2016-06-21 73 views
0

今天,我創建了類似Combobox的任何時間。而且我不知道我無法顯示所有項目可供選擇。不能顯示錶中的組合框

你可以看起來像:

似乎隱藏在桌子後面的組合框的所有項目。

HTML代碼:

<div class="btn-group open"> 
    <button type="button" class="multiselect dropdown-toggle btn btn-white btn-primary" 
      data-toggle="dropdown" title="None selected" aria-expanded="true">None selected 
      <b class="fa fa-caret-down"></b> 
    </button> 
    <ul class="multiselect-container dropdown-menu"> 
     <li><label class="checkbox">Checkbox</label></li> 
     <li><label class="checkbox"> 
      <input type="checkbox" class="ace" value="0"><span class="lbl"></span> STT</label></a> 
     </li> 
    </ul> 
</div> 

CSS代碼:

.btn-group { 
    position: relative; 
    display: inline-block; 
    vertical-align: middle; 
} 

.multiselect-container { 
    position: absolute; 
    list-style-type: none; 
    margin: 0; 
    padding: 0; 
} 

.multiselect-container>li { 
    padding: 0; 
} 

li { 
    display: list-item; 
} 

.dropdown-menu { 
    position: absolute; 
    top: 100%; 
    left: 0; 
    z-index: 1000; 
    display: none; 
    float: left; 
    padding: 5px 0; 
    margin: 2px 0 0; 
} 

如何顯示在我的情況下,組合框的所有項目?謝謝。

回答

1

檢查有關元素的z-index屬性。你想要出現在前面的元素應該比你想要的元素有更大的z-index屬性。